Using an option group to open a form

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
 
H

Howard Brody

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
 

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