Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling Option Group buttons in response to content of a field 1

Status
Not open for further replies.

Locoman

Technical User
Sep 25, 2002
38
GB
Hi folks,
I did look under FAQs, honest, but could not see anything quite like my question:

I have a form with an option group of five buttons which select different reports for various records depending on which option button is selected - so far so good.

I now want to grey out certain buttons when the choice is not relevant for the new record selected. I have tried code like:

If Me!data = "xx" Then
Me!Option3.Enabled = False
etc,..etc...
Else
Me!Option3.Enabled = True
etc,...etc...
End If

This works, but does not automatically "update" the option button group, i.e. the selected disabled button(s) will appear correctly greyed out but only when you click on another button in the group.

Is there a way to make the option button group choices automatically track as the user selects different records on the main form?

 
Hi,


Did you put the code above in the AfterUpdate of your text box?
 
Hi Beeps,

No, I had not put the code there - but i have just tried that and it did not work at all. The only way it seems to work is in its own private sub as Frame(nn)_BeforeUpdate.

Regards,

Brian
 
Is your option group and your text box/recordset on the same form?(i.e. is there a subform involved?)
 
Yes, the option group is on the main form with the text box. So I didn't screw up my work so far, I built a simple test form in a blank db, displaying the only field from a simple table, plus the option group. This test form behaves exactly the same as the full "real" form, as described previously.
Hope that helps!
 
Hi

Your message implies that the form is bound and that you wish to enable/disable buttons depending on the content of a column in the bound record, right?

If yes, put your enable/disable code in the oncurrent event of the form Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top