Regarding command buttons in Access 2007 . . .
Related to a similar thread, http://bytes.com/topic/access/answer...-if-field-null, I have a more basic question, but minimal VBA experience.
I want to keep a command button on a subform disabled until the user enters data into any field-- in other words, enable the button as soon as a record is created and the EncounterID autonumber is generated (which occurs and displays in a hidden field on the form as soon as the user enters data into any other form field).
I've tried dropping this code in various events, including
It almost worked-- I have a similar problem as the user in the old thread-- The button is disabled when EncounterID is null, and stays disabled when EncounterID is NOT null. When I toggle between records, the button is finally enabled.
I want the button to become enabled as soon as the EncounterID is written, without having to toggle between records.
Many thanks in advance to anyone who can help!
Related to a similar thread, http://bytes.com/topic/access/answer...-if-field-null, I have a more basic question, but minimal VBA experience.
I want to keep a command button on a subform disabled until the user enters data into any field-- in other words, enable the button as soon as a record is created and the EncounterID autonumber is generated (which occurs and displays in a hidden field on the form as soon as the user enters data into any other form field).
I've tried dropping this code in various events, including
Code:
Private Sub Form_Current():
If Nz(Me!EncounterID,"") = "" Then
Me!EnrollButton.Visible = False
Else
Me!EnrollButton.Visible = True
End If
I want the button to become enabled as soon as the EncounterID is written, without having to toggle between records.
Many thanks in advance to anyone who can help!
Comment