Command Button Not Visible

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Make a standalone procedure like this:

Private Sub HideShowCommand1()
If CheckBox then
Command1.Visible = True
Else
Command1.Visible = False
End If
End Sub

Now, call this when you change the CheckBox

Private Sub CheckBox_AfterUpdate()
HideShowCommand1
End Sub

Also place it inside your Form_Current event to ensure that the button is
shown/hidden based on the status of the checkbox as you navigate to each
record.
 
Hi all,
I am working in Access 2002 and would like a command button on a form to be
visible under certain conditions, and invisible under other conditions.

Eg: If [checkbox] = true, command button is visible, If [checkbox] = false,
command button is not visible.

I am not sure how to write this code nor on which event. Also, should it be
on the button's event, or on the form?

Any help appreciated.
Thanks
C
 
Hi all,
I am working in Access 2002 and would like a command button on a form to be
visible under certain conditions, and invisible under other conditions.

Eg: If [checkbox] = true, command button is visible, If [checkbox] = false,
command button is not visible.

I am not sure how to write this code nor on which event. Also, should it be
on the button's event, or on the form?

Any help appreciated.
Thanks
C

Code the CheckBox AfterUpdate event:

Me![CommandButtonName].Visible = Me![CheckBox]

Place the identical code in the Form's Current Event.
 
Connie,

For an alternative approach, simply put code like this on the checkbox's
After Update event, and the Current event of the form...

Me.YourButton.Visible = Me.CheckboxName

(of course, substitute the actual name of your command button and your
checkbox)

--
Steve Schapel, Microsoft Access MVP

Make a standalone procedure like this:

Private Sub HideShowCommand1()
If CheckBox then
Command1.Visible = True
Else
Command1.Visible = False
End If
End Sub

Now, call this when you change the CheckBox

Private Sub CheckBox_AfterUpdate()
HideShowCommand1
End Sub

Also place it inside your Form_Current event to ensure that the button is
shown/hidden based on the status of the checkbox as you navigate to each
record.


:

Hi all,
I am working in Access 2002 and would like a command button on a form to be
visible under certain conditions, and invisible under other conditions.

Eg: If [checkbox] = true, command button is visible, If [checkbox] = false,
command button is not visible.

I am not sure how to write this code nor on which event. Also, should it be
on the button's event, or on the form?

Any help appreciated.
Thanks
C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top