Using Case to Open Form

S

SharonInGa

What is the code needed to open a form depending on which option button the
user selects.

grpSelectForm

Case 1 (opens form #1)

Case 2 (Opens form #2)

Case 3 .......
 
R

Rob Parker

Select Case grpSelectForm
Case 1
DoCmd.OpenForm "form#1" 'add any OpenForm parameters you need
Case 2
DoCmd.OPenForm "Form#2"
Case 3
...
Case Else 'deal with othe values of grpSelectForm if they may arise;
you could probably omit this
End Select

Rob
 
M

Mike Painter

SharonInGa said:
What is the code needed to open a form depending on which option
button the user selects.

grpSelectForm

Case 1 (opens form #1) FormName = "form1"
Case 2 (Opens form #2) FormName = "form2"
Case 3 .......
FormName = "form3"
Case Else
Error condition of some sort
end select

DoCmd.OpenForm Formname
 

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