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

Enable

Status
Not open for further replies.

masalachol

Technical User
Apr 8, 2004
20
US
Hello:

What would be your suggestions on the following:

fielda filedb fieldc checkbox
111111 222222 333333

How would you go about writing a simple event that would do the following on the above fields that are on a form.

If fieldc = 3333333
then
disable the checkbox
else
enable the checkbox
fi
 
In the Form's On Current event do something like this

if fieldc = 333333 then
checkbox.enabled = true
else
checkbox.enabled = false
endif
 
Thanks for your reply and sorry that I have taken long on the response.

Private Sub Tracked_Enter()

If Branch = 3000004 Then
Tracked.Enabled = True
Else
Tracked.Enabled = False
End If

End Sub

I am trying your suggestion by right clikcing on the check box field "Tracked" thus going to properties ==> then on "enter" select [event procedure]and click on the .... button. The Private Sub Tracked_Enter() appears and place the suggested if condition statements. Looking forward to hearing what I am doing wrong
 
If the Branch field is text, then you will need to enclose the value in quotes like this:

If Branch = "3000004" Then
.
.
.
 
Also,

You can't disable the control that has the focus.

You should place enable/disable code in the Current event of the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top