MrMcFestoe
Technical User
I want to have a field on my start up form that after a year generates a random number and then the user has to put in another number to carry on using the db.
can somebody tell me where iam going wrong with the following code.
Function PrintUtilitiesRekord()
Checks annual code
Dim Tot, Firstdig, SecondDig, ThirdDig As Integer
FirstDig = 6
SecondDig = 4
ThirdDig =2
If ContPerm <> 1 Then
If Not IsNull(Forms!MainMenu!Rnumber) Then
Tot = Forms!MainMenu!Rnumber
If Forms!MainMenu!codeentry <>(((Tot * FirstDig) + SecondDig /ThirdDig) Then
Docmd.RunMarco "OpenupdateBadPermit"
MsgBox " The code is Incorrect",16," "
Forms!MainMenu!Rnumber.Visible = False
Forms!MainMenu!codeentry.Visible = False
Forms!MainMenu!Button14.Enable = False
Else
Docmd.RunMarco "OpenUpdateGoodPErmit"
MsgBox " The code you entered is correct",48," "
Forms!MainMenu!Rnumber.Visible = True
Forms!MainMenu!codeentry.Visible = True
Forms!MainMenu!Button14.Enable = True
End if
End Function
Does the above look right, i can not get it right, i think i might be using old commands, the bd is in access 2002
any ideas
Thanks People
can somebody tell me where iam going wrong with the following code.
Function PrintUtilitiesRekord()
Checks annual code
Dim Tot, Firstdig, SecondDig, ThirdDig As Integer
FirstDig = 6
SecondDig = 4
ThirdDig =2
If ContPerm <> 1 Then
If Not IsNull(Forms!MainMenu!Rnumber) Then
Tot = Forms!MainMenu!Rnumber
If Forms!MainMenu!codeentry <>(((Tot * FirstDig) + SecondDig /ThirdDig) Then
Docmd.RunMarco "OpenupdateBadPermit"
MsgBox " The code is Incorrect",16," "
Forms!MainMenu!Rnumber.Visible = False
Forms!MainMenu!codeentry.Visible = False
Forms!MainMenu!Button14.Enable = False
Else
Docmd.RunMarco "OpenUpdateGoodPErmit"
MsgBox " The code you entered is correct",48," "
Forms!MainMenu!Rnumber.Visible = True
Forms!MainMenu!codeentry.Visible = True
Forms!MainMenu!Button14.Enable = True
End if
End Function
Does the above look right, i can not get it right, i think i might be using old commands, the bd is in access 2002
any ideas
Thanks People