Yes or No field

Kyriakos

Registered User.
Local time
Tomorrow, 01:09
Joined
Feb 18, 2006
Messages
42
Ok here it is. I think it might be easy for most of you....I have one yes or no field on my form and I want some other fields who depend on that to be disabled all the time unless yes is pressed. When yes is pressed I want them to be enabled. How is thid possible?

Thanks for looking at my post anyway.

Kyriakos
 
ReturnValue = 6 for YES

You need to add the following code to your button that when pressed, Yes-No message appears etc.:

ReturnValue = MsgBox("your message", vbYesNo, "your title")
If ReturnValue = "6" Then
... here goes what ever you want to do after yes is pressed
Else
... here goes what ever you want to do after no is pressed
End If
 
You can do it many ways, if the yes no is a check box then put following code in AfterUpdate event.

Private Sub Checkbox1_AfterUpdate()
If Checkbox1 = -1 Then
[field1].Enabled = True
[field2].Enabled = True
Else
[field1].Enabled = False
[field2].Enabled = False

End If
End Sub

--You can add as much fields in the above code... set all the fields enabled property to "NO"
 

Users who are viewing this thread

Back
Top Bottom