Shading a field

B

Beeyen

Good Day,

I have created a form where I need to auto populate a field with the current
date/time if the yes button is selected. If the radio button is no, then
another field is grayed out.

For example: If Handling Excepiton is yes then the current date and time
field is auto populated, and another associated field called Exceptions
Resolved which requires a manual entry of the end date and time is normal.

If the the Handling exception is no the then the Handling Exceptions and the
Exceptions Resolved is shade grey.

If anyone can offer suggestions or coding, that would be great.

Thank you
 
J

Jeff Boyce

Let's clarify what you want to have happen...

If you are only looking to modify the appearance (shade grey), use the
Backcolor property.

If you are looking to disable the control ("grayed out"), use the Enabled
property.

In either case, you'd add code to the radio button/group's AfterUpdate
event, something like (untested):

If Me!grpThisRadioGroup = 1 Then
Me!xxxx.Enabled = False
Me!yyyy.Enabled = True
Elseif Me!grpTHisRadioGroup = 2 Then
...
End If

Note that the value of the group holding the radio buttons is NOT the same
as the caption on the label of those radio buttons.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

Beeyen

Thanks,

Based on whichever option is selected as part of a subform, I would like the
radio button control, if yes it enters the current date in a date/time field
but if no then the date/time field is grayed out.

What do you think?
 
J

Jeff Boyce

Please take another look at the (untested) code snippet I provided earlier.

You will need some familiarity with VBA and event procedures, but what you
are describing can be managed using something like that code...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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