basic problem with module and the if function

Digby

Registered User.
Local time
Today, 04:22
Joined
Jan 25, 2006
Messages
27
Basically i want the app to open small form that asks you to log in basic combo box to select user and text box to enter password well that works fine and i got it to open my main menu, but depending on whether you are a user or admin depends which menu opens.

So i used an if statement to do that part ie

If user = admin then
DoCmd.OpenForm.......

ElseIf User = user then
DoCmd.OpenForm..........




But because I use an If statement for their password

If TextBox = Password Then
Open form main menu

Else
RunMacro (displays an error message)


So I use the password one first but then i need the other to run in the place of opening the form, so in ecense

If TextBox = Password Then
Open form main menu ----- but instead of this line i want
If user = admin then
DoCmd.OpenForm.......

ElseIf User = user then
DoCmd.OpenForm..........




Else
RunMacro (displays an error message)



but it will not work, if i could get a line to run the menu select i could put it in the password one


hope this all makes sense
 
Digby

Not quite sure what you mean - but have you tried using the 'and' operator in your if statement

if user = admin and textbox = Password then
DoCmd.OpenForm frmOne
else
DoCmd.OpenForm frmTwo
end if
 
Last edited:
did not think about that cheers buddy that should work a treat give me 10 mins
 

Users who are viewing this thread

Back
Top Bottom