Task Find Your Lucky No Using Birthday Enjoy Your Codes
Task Find Your Lucky No Using Birthday Enjoy Your Codes
API Declarations
Task Find Your Lucky No Using Birthday
Rem Developed By Buddhika Fernando
Rem [email protected] , [email protected]
Rem Declare Variables
Dim I, X, Lenth, XLenth
Rate Task Find Your Lucky No Using Birthday Enjoy Your Codes
(1(1 Vote))
On Error Resume Next
Rem Get The Lenght Of Text
Lenth = Len(Text1.Text)
Rem Calculate The Value
Rem Eg : 28011981
Rem For Loop Calculatuing Like This
Rem 2+8+0+1+1+9+8+1
For I = 1 To Lenth
X = Val(X) + Val(Mid(Trim(Text1.Text), I, 1))
Next I
Rem Get Yhe Lenght Of Answer
XLenth = Len(X)
Rem Calculate The Final Answer Until
Rem Answer Lenght = 1
Do Until Len(XLenth) > 2
X = Val(Mid(Trim(X), 1, 1)) + Val(Mid(Trim(X), 2, 1))
If Len(X) = 1 Then X = X: Exit Do
Loop
Rem Display Your Lucky No
MsgBox "Your Lucky No Is [ " & X & " ] ", vbInformation + vbOKOnly, "Lucky No"
Text1.SetFocus
End Sub
Private Sub Text1_Change()
On Error Resume Next
Rem Display Form Caption With Birthday
Rem Using Left,Right And Mid Function
Select Case Len(Text1.Text)
Case 0: Me.Caption = "Get My Lucky No "
Case 1: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 1)
Case 2: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2)
Case 3: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2) & "/" & Right(Text1.Text, 1)
Case 4: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2) & "/" & Right(Text1.Text, 2)
Case 5: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2) & "/" & Mid(Text1.Text, 3, 2) & "/" & Right(Text1.Text, 1)
Case 6: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2) & "/" & Mid(Text1.Text, 3, 2) & "/" & Right(Text1.Text, 2)
Case 7: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2) & "/" & Mid(Text1.Text, 3, 2) & "/" & Right(Text1.Text, 3)
Case 8: Me.Caption = "Get My Lucky No " & Left(Text1.Text, 2) & "/" & Mid(Text1.Text, 3, 2) & "/" & Right(Text1.Text, 4)
End Select
Rem Check Text Lenght
If Len(Text1.Text) <> 8 Then CmdGet.Enabled = False Else CmdGet.Enabled = True
End Sub
Private Sub Text1_GotFocus()
With Text1
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Task Find Your Lucky No Using Birthday Enjoy Your Codes Comments
No comments yet — be the first to post one!
Post a Comment