Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rnd Number Password on a form

Status
Not open for further replies.

MrMcFestoe

Technical User
Apr 6, 2003
119
GB
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 &quot;OpenupdateBadPermit&quot;
MsgBox &quot; The code is Incorrect&quot;,16,&quot; &quot;

Forms!MainMenu!Rnumber.Visible = False
Forms!MainMenu!codeentry.Visible = False
Forms!MainMenu!Button14.Enable = False

Else

Docmd.RunMarco &quot;OpenUpdateGoodPErmit&quot;
MsgBox &quot; The code you entered is correct&quot;,48,&quot; &quot;

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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top