Option Group on Subforms

G

Guest

I have a continuous subform with an option group in the header. There is no
default for the group. I want the user to select one of the choices. When
the user
selects one of the options, the detail section of the subform becomes
visible. There are several repeating rows in the detail section to be
filled out.

All is good until the user completes the first row and returns to the first
text box.
Then their choice in the option group disappears. I tried putting code into
the GotFocus event of the first text box of the subform (OptionGroup.value =
1);however, when the form loads, the value of the option group is now 1 and
I want it to NOT be selected when the form loads.

Its driving me nuts.

Can anyone help?
 
W

Wayne Morgan

See if this will help.

If Me.Recordset.RecordCount > 0 Then
OptionGroup = 1
End If

This will check to see if there are any records before setting the value.
 
G

Guest

That worked perfectly. Thank you very much.

Wayne Morgan said:
See if this will help.

If Me.Recordset.RecordCount > 0 Then
OptionGroup = 1
End If

This will check to see if there are any records before setting the value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top