Conditional Next Form

  • Thread starter Thread starter Chip Melton
  • Start date Start date
C

Chip Melton

Hi, I am realitively new to ACCESS but i am trying to build a form that
holds the General Data (i.e. Name Address and Rank) but i need a button
(which I have created)that will send the person to another Form (Form 1) if
the person puts in a Combo box answer of '1' in the "Rank" Field and
another Form (Form 2) if the "Rank" field is populated with a '2' and still
another form (Form 3) if the rank is '3'. I just cannot seem to get
anything to work. It is probably simple VB but I am very new at that also.
I am thinking it would be a "IIF" statement but everything i have attempted
says "Illogical Error" so that must not be right!!!

Any help would be greatly Appreciated!!!!
Oh, and thanks in advance!!!!
 
Hi, I am realitively new to ACCESS but i am trying to build a form that
holds the General Data (i.e. Name Address and Rank) but i need a button
(which I have created)that will send the person to another Form (Form 1) if
the person puts in a Combo box answer of '1' in the "Rank" Field and
another Form (Form 2) if the "Rank" field is populated with a '2' and still
another form (Form 3) if the rank is '3'. I just cannot seem to get
anything to work. It is probably simple VB but I am very new at that also.
I am thinking it would be a "IIF" statement but everything i have attempted
says "Illogical Error" so that must not be right!!!

Any help would be greatly Appreciated!!!!
Oh, and thanks in advance!!!!

You'ld probably need code something like this, in the AfterUpdate
event of the combo box:

Private Sub cboRank_AfterUpdate()
Select Case Me!cboRank
Case 1
DoCmd.OpenForm "Form 1", <parameters>
Case 2
DoCmd.OpenForm "Form 2", <parameters>
<etc>
Case Else
<put out an error message about unexpected selection>
End Select
End Sub
 
Back
Top