appending 0 records

Seb

Registered User.
Local time
Today, 20:42
Joined
Jun 20, 2006
Messages
55
Hi Guys

this is a query I'm running, which I think is quite simple....why does it not bring anything across?

INSERT INTO tblRunItems ( SiteId, RunId )
SELECT tblsites.siteId, forms.frmRuns.runID
FROM tblSites INNER JOIN (tblRuns INNER JOIN tblRunItems ON tblRuns.runID=tblRunItems.RunId) ON tblSites.SiteId=tblRunItems.SiteId
WHERE ((tblSites.CollectionDay)=forms.frmRuns.runDay) And ((tblSites.CollectionZone)=forms.frmRuns.runZone);

Could someone please help me on this....
 
forms.frmRuns.runID
This returns the value of a text box on your form, not a field value.

It ialso looks as if you text boxes have the same names as the underlying fields. I know Access does this by default, but it's bad practice and can cause all sorts of things to misbehave.
 
Thanks for that....but thats what I wanted to do....
the form creates a new run and issues a new run number (autonumber field)
then I need to run the append query that will put the runId & tblSites.siteID into the tblRunItems table....
do you get what I'm trying to do?? The query needs to run but only for the runID that matches the frmRuns.runID field...???
 

Users who are viewing this thread

Back
Top Bottom