mutual buttons select

H

Huaqin

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
 
C

Craig

As with the print button question earlier, use VBA and the .enable = false
property to "grey" the button.

craig
 
D

Dan Artuso

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.
 
H

Huaqin

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,
 
H

Huaqin

Thanks Craig, Can you please write a bit more in detail, I am poor in VBA.
thanks again..
 
A

AtA

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.
 
D

Dan Artuso

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,
 
C

Craig

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
 
Top