This is what I am trying to avoid:
Private Sub emplt_pstn__AfterUpdate()
On Error GoTo Err_emplt_pstn__AfterUpdate
Dim stDocName As String
Dim stLinkCriteria As String
If Me![emplt_pstn_] = 1 Then
stDocName = "f_02_custodian"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 2 Then
stDocName = "f_02_admin_clerk"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 3 Then
stDocName = "f_02_secretary"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 4 Then
stDocName = "f_02_eqp_rpr"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 5 Then
stDocName = "f_02_rep"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 6 Then
stDocName = "f_02_rep_spvsr"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 7 Then
stDocName = "f_02_crew_mbr"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 8 Then
stDocName = "f_02_frmn"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me!emplt_pstn_] = 9 Then
stDocName = "f_02_inet_liaison"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 10 Then
stDocName = "f_02_scrty"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 11 Then
stDocName = "f_02_public"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 12 Then
stDocName = "f_02_trainee"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 13 Then
stDocName = "f_02_prsnl"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 14 Then
stDocName = "f_02_mgr"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 15 Then
stDocName = "f_02_hr"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn_] = 16 Then
stDocName = "f_02_cstmr_svc"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me!emplt_pstn_] = 17 Then
stDocName = "f_02_sales_rep"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If Me![emplt_pstn] = 18 Then
stDocName = "f_02_off_spvsr"
'stLinkCriteria = "[applcnID]=" & Me![applcnID]
DoCmd.close
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Exit_emplt_pstn__AfterUpdate:
Exit Sub
Err_emplt_pstn__AfterUpdate:
MsgBox Err.Description
Resume Exit_emplt_pstn__AfterUpdate
End Sub
_____________________________________
Now, instead of this laborious VBA above, which is cumbersome when I change,
add, or delete a position, I hope to have the next form (f_02...) be the
appropriate form for the position; a custodian doesn't need to indicate
his/her typing speed, and a sales representative doesn't need to know
custodial terminology, such as a floor buffer, or other equipment. The 2nd
form is determined by the applicant's choice in their job interest.
=============================
Maurice said:
Ok, what we need to know is what identifies the forms as unique. Is it the
name of the form or...
If i understand correctly a form which resembles the next page should be
opened based on the combo filled with positions available. After chosing a
position what is the criteria for opening the form, is it the name of the
position or is it an identifier for a certain group.
Maybe post a small example so we can think aloud with you.