AAlpha1
asked on
How to run a SQL query code and store the results without opening a query?
Given:
A table: tPricing
A query: Select (DeliveryID, PricePeriodID) from tPricing Where (tPricing!DeliveryID = Forms!fPricing!DeliveryID AND tPricing!PricePeriodID = Forms!fPricing!PricePeriod ID)
I then want to save the query results (only 2 fields in one record are possible) in Variables that I can validate (e.g. Null). I do not want to save the same information twice!
Is it doable? How, please?
A table: tPricing
A query: Select (DeliveryID, PricePeriodID) from tPricing Where (tPricing!DeliveryID = Forms!fPricing!DeliveryID AND tPricing!PricePeriodID = Forms!fPricing!PricePeriod
I then want to save the query results (only 2 fields in one record are possible) in Variables that I can validate (e.g. Null). I do not want to save the same information twice!
Is it doable? How, please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used DLookUp once for each field I was looking for. It worked
ASKER
Thanks
ASKER
StrSQL = Select( ........)
DoCmd.RunSQL (strSQL) I expect Two fields from this. Say Field1 and Field2
Var1 = Field1
Var2 = Field2
Will that do it?