Easy question for the pro's

KingRudeDog

Registered User.
Local time
Today, 13:16
Joined
May 12, 2006
Messages
36
I am not yet proficient in programming VB, but even I know the basic's of this one. But I know asking the access gods will make my way smoother....

I want to have a command button visible based on a boolean (checkbox)...

So something like

If boolean1 = true
Then commandbutton73.visible = true

If boolean1 = false
Then command button73.visible = false

And, now that I think about this where would I insert this in the properties, or rather in the event section of properites.

As part of a database, the boolean would remain as the choice for that record every time I went back to it, always leaving the button either visible or invisible for that particular record.
 
Make a Sub like this...
Code:
Private Sub UpdateButtonState()
    If Me.Check5 Then
        Me.Command7.Visible = True
    Else
        Me.Command7.Visible = False
    End If
End Sub
And then add events to the Form_Current and CheckBox_AfterUpdate events...
Code:
Private Sub Form_Current()
    UpdateButtonState
End Sub
Code:
Private Sub Check5_AfterUpdate()
    UpdateButtonState
End Sub
 

Users who are viewing this thread

Back
Top Bottom