message box with D look up

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

i have a product list form that i want a click button that will load
up a message box displaying stock level

What code would i use to do this

DLookup("[StockLevel]", "qryStock", "[ProductID]=" & Me.ProductID)

Message box
Stock level is ????

OK button


Can some one point me in right direction
 
MsgBox "Stock Level is " & _
DLookup("StockLevel", "qryStock", "ProductID=" & Me.ProductID)

If ProductID is a text field and not a number field then you need a slight
modification.
MsgBox "Stock Level is " & _
DLookup("StockLevel", "qryStock", "ProductID=""" & Me.ProductID & """")

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top