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 Group only selectable once 1

Status
Not open for further replies.

royhouser

Programmer
May 15, 2002
89
US
I have an option group on a splash form for selecting a single form from a group. The problem with it is that you can only select an option once. I'm using option/radio buttons, and right now the selected event is loaded on the option groups click event (using a Case Statement). If someone clicks on form1 then form1 loads, when they close it if they forgot something and try to open it again, the have to click off of that option button and then click it again to go to that form. Clear as mud? Does anyone know how to get this to work right?


royhouser
[hourglass]
More is lost by Indecision than Wrong Decisions
 
Give the Option Group a default value of Null. The option group is carrying over the value that was left there the last time used.

Let me know how this works out for you.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
That work's. Now, is it possible to have my cake and eat it too. Can I do this and also have it indicate which option was selected last?

royhouser
[hourglass]
More is lost by Indecision than Wrong Decisions
 
Does the splash form stay open in the background when you open the requested form and change focus to that form? If it is then the following will work. This example goes in the AfterUpdate of the Frame:
Select Case Me.Frame0
Case 1
Me.Label3.BackColor = 255
Me.Label5.BackColor = 16777215
Me.Label7.BackColor = 16777215
DoCmd.OpenForm "frmFrmName1", acViewPreview
Case 2
Me.Label3.BackColor = 16777215
Me.Label5.BackColor = 255
Me.Label7.BackColor = 16777215
DoCmd.OpenForm "frmFrmName2", acViewPreview
Case 3
Me.Label3.BackColor = 16777215
Me.Label5.BackColor = 16777215
Me.Label7.BackColor = 255
DoCmd.OpenForm "frmFrmName3", acViewPreview
End Select
Me.Frame0 = Null

What this does is changes the label backcolor associated with each of your radio option buttons to either red(255) or white(16777215) depending on which form is opened. The last thing the code sets the frame value back to Null. When the called form is closed and the focus returns to this splash form all the option radio buttons are unselected but the label of the form that was called will be red. Upon selecting another form the process starts over again.

You said you wanted "your cake and eat it too" and I made sure there was no indecision here and made the right decision for you. [2thumbsup]

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
tell me about it.....some times you just need pointed in the right direction then along comes superman and carries you over the river and through the mountains to get you there faster and safer.....Thanks a million.

royhouser
[hourglass]
More is lost by Indecision than Wrong Decisions
 
Glad to help and thanks for the Star. It is appreciated.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top