I have a form with a combo box that has six values being pulled from a table "Catches 1 - 22 Salmon", "Catches 1 22 Sea Trout" plus another 4 values.
I have six corresponding reports called "Cathces122Salmon", "Catches122SeaTrout" plus another 4 reports.
What I want (obviously) is to open the report "Catches122Salmon" when I select "Catches 1 - 22 Salmon" from the combo
When I use the code below on a command button, a report opens but it is not the one referred to in the If..Else statement. For example, If I select "Catches 1-22 Grisle" from the drop down it opens "Catches122SeaTrout"
Private Sub Command5_Click()
Dim strForm As String
If Me.Combo6 = 1 Then
strForm = "Catches122Grisle"
ElseIf Me.Combo6 = 2 Then
strForm = "Catches122Salmon"
ElseIf Me.Combo6 = 3 Then
strForm = "Catches122SeaTrout"
ElseIf Me.Combo6 = 4 Then
strForm = "Catches2332Grisle"
ElseIf Me.Combo6 = 5 Then
strForm = "Catches2332Salmon"
Else
strForm = "Catches2332SeaTrout"
End If
'Debug.Print strForm
DoCmd.OpenReport strForm, acViewPreview
End Sub