mutual buttons select

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

Guest

Hi everyone,

Can someone tell me how to do the following?

I have a form for employee, there are buttons (or check box) for full-time
and part-time. I want to check the full-time button, the part-time button
greys out automatically, or vise versa.

Thanks much for your help!
New Kid in Access DB
Huaqin
 
As with the print button question earlier, use VBA and the .enable = false
property to "grey" the button.

craig
 
Hi,
From the Toolbox select an Option Group and place on your form.
Then select an Option Button and place that on the Option Group.
You will see the Option Group go black.
 
Thanks Dan!

I have another question on this, I don't want to use group option, what
other option I have, like do a little macro to grey out the other choice?

Like if I select full-time button, the part-time button greys out
automatically, I set two variables for them.

Thanks again,
 
I agree with Dan, but if you really want to have to fields then in write in
the AfterUpdate or OnClick Event Procedure something like:

If Me.FullTime=True then
Me.PartTime.Enabled=False
Else
Me.PartTime.Enabled=True
End If

To get to Event Procedure go to Properties of the control and then select
Event tab and in the appropriate event select [Event Procedure] and click
the button at the end of the row. Then write the above command.
 
or even simpler:

Private Sub Option2_AfterUpdate()
Option4 = Not Option2
End Sub

Private Sub Option4_Click()
Option2 = Not Option4
End Sub


--
HTH
Dan Artuso, Access MVP


AtA said:
I agree with Dan, but if you really want to have to fields then in write in
the AfterUpdate or OnClick Event Procedure something like:

If Me.FullTime=True then
Me.PartTime.Enabled=False
Else
Me.PartTime.Enabled=True
End If

To get to Event Procedure go to Properties of the control and then select
Event tab and in the appropriate event select [Event Procedure] and click
the button at the end of the row. Then write the above command.


Huaqin said:
Thanks Dan!

I have another question on this, I don't want to use group option, what
other option I have, like do a little macro to grey out the other choice?

Like if I select full-time button, the part-time button greys out
automatically, I set two variables for them.

Thanks again,
 
Ok here goes:

on the after update event for the fulltimebutton, place the following:

if me.fulltimebutton = -1 then
me.parttimebutton.enable = false
else
me.parttimebutton.enable = true
end if

vice versa for the parttime button after update event.

hope this helps.

craig
 
Back
Top