Combo Box SQL

  • Thread starter Thread starter mrrherrera
  • Start date Start date
M

mrrherrera

I have the code that allows the combo box to open another form (see my post
of 7/8/08 and Beetles' last response.) However, when I select an item for
which I don't need another form, it brings up the last form. What am I
missing in the code? Thanks.
 
So it opens a form no matter what you select in the combo?

Can you post the code as it currently is?
 
I scratched that whole database and started over. The combo box now works.
However, I have several items that I don't need a form to pop-up when
selected. When one of these is selected, the last form in the code opens.
What do I need to add to the code so it'll just leave the selection made and
not open a form? Here is the code:
Private Sub Item_Change()
If ([Item] = "Computer") Then
DoCmd.OpenForm "Computer"
Else
If ([Item] = "Firearms") Then
DoCmd.OpenForm "Firearms"
Else
If ([Item] = "Cell Phones") Then
DoCmd.OpenForm "Cell Phones"
Else
If ([Item] = "Furniture") Then
DoCmd.OpenForm "Furniture"
Else
[Item] = "Vehicles"
DoCmd.OpenForm "Vehicles"
End If
End If
End If
End If



End Sub
 
Back
Top