PDA

View Full Version : Solved: Option Group Question



CreganTur
07-29-2008, 01:36 PM
I've got an option group that contains 2 option (radio) buttons: optApproved and optDenied.

When the form containing this option group first opens, both option buttons are greyed out(see image below), since no selection has been made- I'm perfectly fine with this. When the user finishes with the current record on the form, they click a "Next Account" button that uses 'DoCmd.GoToRecord , , acNext' to move to the next record.

Now, I want to know how to grey out the option buttons right after the User moves to the next record (they can only move via the "Next Record" button). The reason for this is due to the fact that the selected option button stays selected when the form moves to the next record. I want to accomplish this so the User can't accidentally move to the next record without selecting an option.

I tried assigning a value to the option button, like I would for a checkbox:
Me.CheckBoxName = True '<<<Make box checked
Me.CheckBoxName = False '<<<Make box unchecked
but this threw an error that stated "You cannot assign a value to this object," which kills that idea :mkay

Any ideas? :dunno

Mavyak
07-29-2008, 02:55 PM
Try changing the owning frame value like so:

Private Sub Detail_Click()
Frame0 = Null
End Sub

OBP
07-30-2008, 02:34 AM
If Frame0 = Null doesn't work try
Frame0 = 0
Put the Code in the Form's "On Current" Event Procedure.
Your Frame may not be Numbered 0 it could be Frame1, Frame2 etc.

CreganTur
07-30-2008, 07:10 AM
Mayvak's = Null worked perfectly!

Thanks Tony, for suggesting the 'On Current' Event- works like a charm now.


Your Frame may not be Numbered 0 it could be Frame1, Frame2 etc.
My frame was renamed to optExtension, since use of default object names is a best-practice no-no(:whip )

As the Brits (and affiliated Anglo-Saxon cultures[except for us Yanks]) say, Cheers!:beerchug: