How do I get my command buttons to rebound after one click?

  • Thread starter mphotographer via AccessMonster.com
  • Start date
M

mphotographer via AccessMonster.com

On my form I have 4 command buttons, two as searches and two as print actions,
that have procedures that start "on click." My problem is that when I click
the button does not rebound. In order for it to pop back up I must click it
again which starts the process again. I have tried these as "on mouse down"
actions as well with same results. Is there a way that when I click these
buttons the first time it will automatically rebound?

Here is my coding for one of the buttons.

Private Sub Toggle50_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)

If IsNull(File_Ref) Or File_Ref = "" Then
Me.FilterOn = False
Me.Filter = ""
Else
Me.Filter = "[File] like '*" & File_Ref & "*'"
Me.FilterOn = True
End If

End Sub
 
B

Baz

Those aren't command buttons, they are toggle buttons. The command button
tool is the one with just one rectangle, not the one with two rectangles.
 
F

fredg

On my form I have 4 command buttons, two as searches and two as print actions,
that have procedures that start "on click." My problem is that when I click
the button does not rebound. In order for it to pop back up I must click it
again which starts the process again. I have tried these as "on mouse down"
actions as well with same results. Is there a way that when I click these
buttons the first time it will automatically rebound?

Here is my coding for one of the buttons.

Private Sub Toggle50_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)

If IsNull(File_Ref) Or File_Ref = "" Then
Me.FilterOn = False
Me.Filter = ""
Else
Me.Filter = "[File] like '*" & File_Ref & "*'"
Me.FilterOn = True
End If

End Sub

The behavior you mention is that of a Toggle Button, not a Command
Button.
Look at your code....
Private Sub Toggle50

Replace the Toggle Button with a Command Button.
Code the Command Button Click event with your code.
 
M

mphotographer via AccessMonster.com

Thank you that was it. Its just those simple things I don't pay attention to
I guess.

On my form I have 4 command buttons, two as searches and two as print actions,
that have procedures that start "on click." My problem is that when I click
[quoted text clipped - 17 lines]

The behavior you mention is that of a Toggle Button, not a Command
Button.
Look at your code....
Private Sub Toggle50

Replace the Toggle Button with a Command Button.
Code the Command Button Click event with your code.
 

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

Top