Query based on row in continuous form

vapid2323

Scion
Local time
Today, 02:08
Joined
Jul 22, 2008
Messages
217
Ok I thought this was going to be simple but I must be missing something.

I have a continuous form that has multiple tabs in the form footer.

Anyhow I have a combo box on one of the tabs that is working with the following query.

Code:
SELECT tblSiteStaff.SiteStaffID, tblSiteStaff.FirstName, tblSiteStaff.LastName, tblSite.SiteStaff.Value, tblSite.SiteID
FROM tblSite LEFT JOIN tblSiteStaff ON tblSite.SiteStaff.Value = tblSiteStaff.SiteStaffID
WHERE (((tblSite.SiteID)=[Forms].[frmSitesOverview].[SiteID]))
ORDER BY tblSiteStaff.LastName;

Basically I set the Criteria of the SiteID field to: [Forms].[frmSitesOverview].[SiteID]

But it’s not able to see that field for some reason so I keep getting that popup asking for me to enter the value.

The query works if I had type the siteID but I have no idea why its not finding it on its own...
 
Is the form open when the query runs? It needs to be. If so, double check the spelling of the form and combo names.
 
Is the form open when the query runs? It needs to be. If so, double check the spelling of the form and combo names.

Thats what I first thought, I just ran over all the details a second time and everything is correct.

The form is open (the combo box is on the form itself)
The Spelling is correct
I do have a ReQuery set but its not the issue at this point
Without the Criteria the query works fine
Adding the siteID in the popup works(this should mean my spelling is correct?)

I dont have a clue at this point, I even added a second SiteID field in the particular Tab I am working on and its still not finding it.
 
I just knew it was going to be something simple....

I needed to use [Forms]![frmMain_toplg]![subform1]![SiteID]

I have everything wraped in a main form, I just spaced it out >.<
 
Glad you got it sorted out.
 

Users who are viewing this thread

Back
Top Bottom