hi,
h3llz wrote:
[Quoted Text] > INSERT INTO tblProductsLog ( staffID, productID, [timestamp], quantity ) > VALUES ([staffID], [productID], now(), -[quantity]); > > i got that in a query, but when i use DoCmd.OpenQuery it asks me for > variables which is already set before i execute it, therefore i need to do > the query some other way? please help :<
You cannot set parameters for query when using DoCmd.OpenQuery. You need to use a QueryDef object for that, e.g. something like that:
Dim qd As DAO.QueryDef
Set qd = CurrentDb.QueryDefs.Item("nameOfYourQuery") qd.Parameters.Item(<NameOrIndex>).Value = <yourValue> qd.Execute Set qd = Nothing
mfG --> stefan <--
|