SetProperty

  • Thread starter Thread starter Harvard
  • Start date Start date
H

Harvard

I have a checkbox field named Highlight. When I open the form, I would like
this field to be disabled unless CurrentUser = "Admin". Is that possible?
And should i be using a macro or some other method?
 
Harvard,

Bonnie has given a VBA solution. A simplified version of her code is:
Me.Highlight.Enabled = CurrentUser = "Admin"

But yes, you can also do this with a macro. Either using a SetValue
action, or SetProperty as you suggested. This would be on the Current
event of the form. Set the arguments of the SetProperty action like this:
Control Name: Highlight
Property: Enabled
Value: =([CurrentUser]="Admin")
 
Harvard,

Just thinking, since the CurrentUser will not change within a given
session of the database, you could also put this code on the form's Open
or Load event, in fact this would probably be preferable to the Current
event.
 
Back
Top