Option Group on Subforms

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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.
 
Back
Top