Using an option group to open a form

  • Thread starter Thread starter Colin Foster
  • Start date Start date
C

Colin Foster

Hi,
I have an option group on a form which has two options...somethink is OK or
it isnt. If it's not OK, then I need a form to open up (frmdiscrepancy) to
have details input. This will then need to be accessed at a later date to
have further information added.
I did think of using a pop up form, but I'm not so sure, now and wonder
whether anyone has any ideas or suggestions of both which method to use and
what the code would be?
Regards
Colin Foster
 
OK, so the values of your OptionGroup (optOK) are:

1 - OK
2 - Not OK

Try this in the OnClick event:

Private Sub optOK_Click()

' declare variables
Dim strForm as String

' select form (or not) based on selection
Select Case optOK
Case 1
Exit Sub
Case 2
strForm = "frmDiscrepancy"
End Select

' open selected form
DoCmd.OpenForm strForm, acNormal

End Sub

In other situations, you can expand this to let you select
from multiple forms.

Hope this helps!

Howard Brody
 
Back
Top