WHERE (((tblserviceowner.ServiceID)=[forms]![frmorderdata]![subfrmserviceorder].[form]![serviceid]) AND ((tblserviceowner.CustomerID)=[forms]![frmorderdata].[customerid]) AND ((tblserviceowner.ServiceAgreedPrice)=[forms]![frmorderdata]![subfrmserviceorder].[form]![ServiceOrderPQAgreedPrice]));
I have created the above query to find the current quantity based on a certain set of criteria. What i would like to do is then use this data within a form to carry out further opperation. I have a command button that calls the query docmd.openquery strdocname and obviously it shows the result in a datasheet, is there anyway to not show the data sheet and just use the value that is returned?
i want the code do something like the following:
dim strdocname as string
dim lngQTY as long
strdocname = "queryname"
docmd.openform strdocname 'or whatever the code would be to retrieve the value
lngQTY = 'whatever the code is to set the variable to the value retrieved by the query
if lngqty = 1 then
call delete query to remove the record based on criteria (i do know how to do this)
call update query to deduct 1 from the total quantity retrieved by the query (this i do know how to do
any help would be very much appreciated.