M
mrrherrera
On my form I have a combo box. That when an item is selected it will bring
up another form. Of the 13 fields available only 5 or will need the separate
forms. I have created a nested if then statement. However, each time I
select one of the items that will bring up the separate form, I get an error
else if without if.
This is the code:
Private Sub Categories_Change()
If Item = "Computer" Then
DoCmd.OpenForm "Computer"
Else
If ([Item] = "Furniture") Then
DoCmd.OpenForm "Furniture"
Else
If ([Item] = "Phones") Then
DoCmd.OpenForm "Narcotics"
Else
If ([Item] = "Vehicle") Then
DoCmd.OpenForm "Vehicle"
Else
[Item] = "Printer"
DoCmd.OpenForm "Printer"
End If
End If
End If
End If
End Sub
up another form. Of the 13 fields available only 5 or will need the separate
forms. I have created a nested if then statement. However, each time I
select one of the items that will bring up the separate form, I get an error
else if without if.
This is the code:
Private Sub Categories_Change()
If Item = "Computer" Then
DoCmd.OpenForm "Computer"
Else
If ([Item] = "Furniture") Then
DoCmd.OpenForm "Furniture"
Else
If ([Item] = "Phones") Then
DoCmd.OpenForm "Narcotics"
Else
If ([Item] = "Vehicle") Then
DoCmd.OpenForm "Vehicle"
Else
[Item] = "Printer"
DoCmd.OpenForm "Printer"
End If
End If
End If
End If
End Sub