Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box with multiple query names 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I have a comboBox on my form with about 8 query names from a Query Name Table. When I select a Query from the Dropdown it opens the query. What I would like to do is if a Query named OutOfStockQRY-ALL is selected I would like to open the query and send a email. If the OutOfStockQRY-ALL is not selected I just want to open the Query. Below is the code I currently have. I know how to send the email I just do not know how to make it send the email if it is only OutOfStockQRY-ALL.


Code:
Private Sub FourFiveAvgPctQry_AfterUpdate()

DoCmd.OpenQuery Me.FourFiveAvgPctQry
Me.FourFiveAvgPctQry = Clear

End Sub
 
Code:
IF Me.FourFiveAvgPctQry = "OutOfStockQRY-ALL"
    'Send e-mail here
End If

Alternately, you could add a yes/no field to your query table and then add it as a field (possibly not visible) to your drop down. Say the combobox is two columns and the second has the yes/no field...

Code:
IF nz(Me.FourFiveAvgPctQry.column(1),False) = True
    'Send e-mail here
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top