Hi,
I want to be able to select multiple values from a form and then run a query from those values. I read through some posts and learned I cannot use a combo box, that I have to use a list box. I have no idea what to do next besides create the list box.
I have a table of Plants that I want to be my drop down. I assigned those to the list box. I created an OK button to open the query with the following code:
Private Sub OK_Click()
Me.Visible = False
DoCmd.OpenQuery "ShortCode_byPlant", acViewPivotTable, acEdit
DoCmd.Close acForm, "Test"
End Sub
Then I put the following in the query criteria for the Plant field: Like IIf([Forms]![Test]![PlantList]="All","*",[Forms]![Test]![PlantList])
But, I don't get any values returned. Any help would be appreciated. Thanks!
I want to be able to select multiple values from a form and then run a query from those values. I read through some posts and learned I cannot use a combo box, that I have to use a list box. I have no idea what to do next besides create the list box.
I have a table of Plants that I want to be my drop down. I assigned those to the list box. I created an OK button to open the query with the following code:
Private Sub OK_Click()
Me.Visible = False
DoCmd.OpenQuery "ShortCode_byPlant", acViewPivotTable, acEdit
DoCmd.Close acForm, "Test"
End Sub
Then I put the following in the query criteria for the Plant field: Like IIf([Forms]![Test]![PlantList]="All","*",[Forms]![Test]![PlantList])
But, I don't get any values returned. Any help would be appreciated. Thanks!