I have a continuous form on which I would like to hide a command button based on the value of a text field ("Notes") within the same record. I'm very new to VBA but so far was able to find the following partial solution:
I have the following happen OnLoad for the form:
The problem is that once the form loads all the "my_button"(s) in every record become invisible or visible based, I guess, on the value of the "Notes" in the first record.
I found lots of threads speaking about this issue and also visited http://lebans.com/conditionalformatting.htm
The closest solution was the table "ShowHideControls" on the site mentioned above, but due to my lack of knowledge in VBA I wasn't able to translate/understand his code well enough to apply to my example. His table loads text on the button if the checkbox is ON - I guess this could be somehow translated to: "my_button appears if the Notes is Null" in my db.
Can someone please help?
I have the following happen OnLoad for the form:
Code:
Private Sub Form_Load()
If IsNull(Me.Notes) Then
Me.my_button.Visible = False
End If
End Sub
The problem is that once the form loads all the "my_button"(s) in every record become invisible or visible based, I guess, on the value of the "Notes" in the first record.
I found lots of threads speaking about this issue and also visited http://lebans.com/conditionalformatting.htm
The closest solution was the table "ShowHideControls" on the site mentioned above, but due to my lack of knowledge in VBA I wasn't able to translate/understand his code well enough to apply to my example. His table loads text on the button if the checkbox is ON - I guess this could be somehow translated to: "my_button appears if the Notes is Null" in my db.
Can someone please help?