SetProperty

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?
 
S

Steve Schapel

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")
 
S

Steve Schapel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top