View Full Version : Running SQL in a Module


Geoff Codd
08-28-2002, 06:53 AM
I'm trying to run the following code in a module, but can't get my head round it.

INSERT INTO DataWater ( Point_Id, [Date], Direct )
SELECT Direct_Reading_Meters_Without_Reading.Id, [Forms]![Report Criteria Selection]![Start_Date] AS [Date], "D" AS Direct
FROM Direct_Reading_Meters_Without_Reading
WHERE (((Direct_Reading_Meters_Without_Reading.Type)="Water"));

Any help always appreciated
Thanks
Geoff

Travis
08-28-2002, 07:44 AM
You have two methods available for running update type queries easily:

DoCmd.RunSQL

or

CurrentDb.Execute