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

option group reset

Status
Not open for further replies.

Shift838

IS-IT--Management
Jan 27, 2003
987
0
0
US
I am trying to reset my entire form with a reset button, which will reset all the list boxes, the option group etc. how can this be done? I have figured everything out but how to reset the option group option buttons.

 

For your optiongroup control I assume this is linked to a field in an underlying table.

Just set the field to the default value for the option group.

Here is an example

me!OptionField = Optiongroup.DefaultValue

If you are trying to reset it to the previous value (not the default)

me!OptionField = Me!OptionField.OldValue

Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
I get an invalid use of property when I do that. The control is not linked to anything.

I have two option buttons within a group called FRAOPTIONS. each option button is : blnfixed and blnrange
When I click on the reset button on the form I want to clear what was selected on either optoin button, only one will be selected, but I do not which at the time so I will need to clear both.
 
The option buttons should each have a numeric value, check the properties, ie 1 and 2. Set fraoptions to a lower number than the lowest ie 0 or -1.
 
would it be like fraoptions.value = "-1" ?
 
The value is numeric so no quotes are required ie

fraoptions = 0 or fraoptions = -1
 
Ok. I found this post, and it is exactly what I was looking for. One problem, it isnt working. I have a tab control. On open of the form, I have controls set invisible, so that all you see is the tab control, and 1 option group. When you make a choice on the option group, another shows. When you make a choice on that, a button shows and you can view the report u just chose.

If the person clicks the other page of the tab control, I need to reset the option groups and the button so that nothing is chosen and they go invisible again.

this code:
Private Sub PgDetail_Click()
FrmStatGroup = -1
FrmStatType = 0
End Sub

isnt doing it. I tried 1 with -1 and 1 with 0. I have tried a bunch of things, and nothing is working. Can someone please help?

Thanks.

misscrf

It is never too late to become what you could have been ~ George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top