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

Disabling text boxes

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have got four text boxes on my form displaying data from an Access table. I was wondering if there was a way I could disable these four text boxes depending on the user? I have a field in the table which determines if they should be enabled/disabled but how can I get the boxes to be enabled based on this value from the table?
 
Hi Mr HP,
In visual basic in your forms "On current" event you'd add something like:

Me.AnotherField.SetFocus
If Me.NameOfKeyField = Whatever Then
Me.Text1.Enabled = False
Else
Me.Text1.Enabled = True
End if

If you need "deeper" help with this write back... Also make sure "AnotherField" is one that would not be disabled. That's it! Gord
ghubbell@total.net
 
Hi Gord,

Many thanks for the tip.
I have already got a macro running on the On Current event, but I put the code you gave me within the On Load Event Procedure on my form instead and it works fine!

Thanks a lot, you saved me loads of time!

Cheers,
Hanish.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top