Andy K wrote:
Hello everyone,
I have a form with an option button on it. I am having problems to set
the value of this to is previous state/selection.
For instance if someone navigates from the main menu to the specific
form and selects an option and the back to the main menu. If they go
back to the form i want the previous option to be selected.
Any ideas please. Thanks in advance for your help.
If I understand your situation...not sure what an option is and what
value of an option to save...you could create a field on your main form
to store a value. When an "option" is selected, it checks to see if the
main form is open and if it is, sets a value to that field in the main form.
Sub Option_AfterUpdate()
If IsOpen("MainForm") then 'see Syscmd to create IsOpen function
Forms!MainForm!OptionField = "Whatever"
Endif
Then, when you open the form from the mainform, you can check the value.
Ex:
If IsNull(Me.OptionField) Then
Docmd.openform "Test"
Else
Docmd.Openform "Test",,,"ID = " & Me.OptionField
Endif