Dim out command buttons

  • Thread starter Thread starter RobC
  • Start date Start date
R

RobC

I have a form with several command buttons on it that print different
labels. Is there a way to have the command button or some other object on
the form to dim out after it has been pushed for printing. In other words,
if I have 10 buttons I want the user to be able to see that they have
printed label 1,2 and 3, but still have not printed 4,5,6, etc.
Any suggestions from anyone on how to accomplish this or something similar?
Thank you in advance.
Rob
 
Simple answer: in the Click event code for the button you need to disable the
button...

Private Sub Button1_Click()

Button1.Enabled = False
'More code to print your labels ...

End Sub

Complicated answer:

If you want to track what's been printed for each record in a table, you
will need to have fields in the table to store this information (or if you
want to get really flash, records in a related table would be a better
design). Then, as well as the code above, you would also need to update the
print status as part of the button click event. Finally you would need to
code the Form_Current event (or if the form is unbound, the event that loads
data into your form) to check the print status of the currently displayed
record and enable/disable buttons as appropriate.

Jon.
 
Jon Ley said:
Simple answer: in the Click event code for the button you need to
disable the button...

Private Sub Button1_Click()

Button1.Enabled = False
'More code to print your labels ...

End Sub

But I think there will also have to be a line in there to set the focus
someplace else, since you can't disable a control that has the focus,
and at the start of its Click event, Button1 will have the focus.
 
Gosh darn it - I always forget that bit!

:

snip> But I think there will also have to be a line in there to set the
focus someplace else...
 
Back
Top