Field Visible depending on table field repsonse

GraemeG

Registered User.
Local time
Today, 06:01
Joined
Jan 22, 2011
Messages
212
Hello.

Is there a way to make a field on a form visible or not visible dependant on repsonses made in a table.

I.e
I want a button for admin tools to appear when the admin user is logged in.

Code:
Private Sub Form_Load()
If Tbl_Users_EngineerID = "Administrator" And Tbl_Users_fldLoggedIn = True Then
Me.cmdAdminTools.Visible = True
Else
Me.cmdAdminTools.Visible = False
End If
End Sub

I have the above code but it does not work.
Any help appreciated.
 
It's all very well saying "It does not work" but what is not working? do you get an error message? which part of the code appears not be be correct?

More info needed.
 
It's all very well saying "It does not work" but what is not working? do you get an error message? which part of the code appears not be be correct?

More info needed.

Sorry yeah. The field is visible which ever user logs in.
 
Have you tested that both conditions have been met? have you stepped through the code?
 
Have you tested that both conditions have been met? have you stepped through the code?

Yeah I have checked which ever user is logged in that the conditions are right. However it is as if the code does not do anything. Can you look at a field repsonse in a table not bound to the form? The field is nowhere on the form by the way.
 
If Tbl_Users_EngineerID = "Administrator" And Tbl_Users_fldLoggedIn = True Then

are these 2 items variables or actual field names in tables?
 
I Think? you wrore the program not me!

What is happening when a user logs on?

Send me you app?
 

Users who are viewing this thread

Back
Top Bottom