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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: Forms - How can I disable some fields?

Status
Not open for further replies.

fallyhag

Technical User
Mar 31, 2001
78
GB
I have a few fields in my form, and one of them is a lookup field. I want the user to choose an option in one field and then go to the next. However, if he chooses a certain option then the other fields are not applicable so I wanted to grey them out (disable them) if this option was picked in the lookup.

Any ideas folks?

Thank you in advance

Fallyhag
 
Hi

Basically you use

MyField.Enabled = False

or

MyField.Enabled = True

in the after update event of the 'look up' field

You could hard code this, eg

If MyLookup = "X" Then
MyField.Enabled = True
Else
MyField.Enabled = false
End if

But if the uptions are likely to change then you may wish to consider making the option a user maintainable one (ie 'soft'), you could do this by defining an extra column (say chkEnabled) in the table used as the source of the look up field, increase the number of columns in the look up to include chkEnabled, set the column width to zero so user does not see teh extra column, then in the after update event of the look up
If MyLookUp.Column(1) Then
MyField.Enabled = True
Else
MyField.Enabled = False
End if

Hope this helps

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top