How I can set a text field’s properties Enabled = No

itlearner

Registered User.
Local time
Today, 10:33
Joined
Jun 13, 2006
Messages
20
In a simple data retrieve/update form, how I can set a text field’s properties Enabled to No based on that particular record value?

For instance, there are 4 fields, employeeid, employeename, employeetitle, employeephone
I would like to set the employeephone text field’s properties Enabled = No, if the employeetitle is Manager

Can anyone help?
 
Is this what you want?

Code:
If Me.txtEmployeeTitle= "Manager" = True Then
    Me.txtEmployeePhone.Enabled = False
Else
    Me.txtEmployeePhone.Enabled = True
End If
 
Yes. You are right. Where you put the code in? Which event? I have put it under Detail On Click event, it doesn’t work the way I want. There are more than one record are displayed. When I click on a particular record, the whole list of records are also changed ;-(

Private Sub Detail_Click()

If txtEmployeeTitle = "Manager" = True Then
txtEmployeePhone.Enabled = False
Else
txtEmployeePhone.Enabled = True
End If

End Sub

Any Suggestion?
 
That'd go under On Current code and AfterUpdate event wherever you set the field to Manager, if necessary.
 
Thanks Banana. I have put the code under On Current only, works.
 

Users who are viewing this thread

Back
Top Bottom