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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Button

Status
Not open for further replies.
May 12, 2002
51
US
I want two option buttons on a form, one for "Mono" and one for "Stereo". IF the user clicks "Mono", the word Mono should populate a field called "MonoOrStereo" in a table called "ProgramData". If they choose "Stereo" it should populate a field called "MonoOrStereo" with "Stereo" in a table called "ProgramData". Heeeelp? Thanks!
-JusTin
 
Hi,

In the CLICK event of the FRAME object that contains your option buttons

select case me.FRAMEOBJECT
case 1 'OPTION STEREO
me("TextBoxLinkedWithStereoOrMonoField")="STEREO"
case 2 'OPTION MONO
me("TextBoxLinkedWithStereoOrMonoField")="MONO"
End select

that should do it! Salvatore Grassagliata
 
Create a hidden text box to called MonoStereo on the form where the Option Button appear. I am going to assume the option buttons are in an option frame and not stand alone (If you click on one, the other is unclicked). Using the AfterUpdate Property of the [Frame] that the option buttons are in, put the following code:

Me![MonoStereo] = IIf(Me![Name Of Frame]=1, "Mono", "Stereo")

Just be sure to check the value number and make sure the is matches whatever Mono is supposed to be. Programming isn't a profession of choice.
It's a profession of calling...
"Hey Programmer, your application broke again!" [spin]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@ssmb.com
 
IF I use this code:

select case me.FRAMEOBJECT
case 1 'OPTION STEREO
me("TextBoxLinkedWithStereoOrMonoField")="STEREO"
case 2 'OPTION MONO
me("TextBoxLinkedWithStereoOrMonoField")="MONO"
End select



I reopen the form, and both mono and stereo are blank. Neither one is checked. How do I get it to save on the form? Thanks!
-JusTin
 
This is the code I am using now:

Private Sub ChooseMonoStereoFrame_Click()
Select Case Me.ChooseMonoStereoFrame
Case 1 'OPTION Stereo
Me("StereoMonoText") = "Stereo"
Case 2 'OPTION Mono
Me("StereoMonoText") = "Mono"
End Select



It saves in the appropriate table, but doesn't save on the form. Any idea's? Thanks!
-JusTin
 
Hi,

you need to have code in your LOAD event on your form.

if me.txtStereoMonoText = "Stereo" then
me.ChooseMonoStereoFrame = 1 'Stereo
else
me.ChooseMonoStereoFrame = 2 'Mono
end if

Just don't forget to modify this code a little bit if NULL is a possibility.

Hope it helps you out!

Salvatore Grassagliata
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top