Hi all-
I have been struggling combo boxes for days and would appreciate any ideas. The first combo box lists sites and the second Leases. What I am after is after selecting a site that only the leases for that site are dispalyed in the second cbo.
Form Record Source is M_ReceiptSlip
Site is defined by cboSites_IDs whose control source is ReceiptSlipSites_IDs
Row Source a query
Lease Name is defined by cboLeases_IDs whose control source is
ReceiptSlipLeases_IDs
Row Source a query
The table L_Site has primary key Site_ID related to table L_Lease foreign key LeaseSites_IDs.
The 1st query works fine but the second returns no records.
I have tried moving the Where [Forms]![F_ReceiptSlip]![cboSites_IDs] but still get blanks. I think this reference is the problem since when I enter an actual value as the criteria records are correctly returned. I can't seem to contect it to the value in the form though.
Any suggestions greatly appreciated. Thanks
I have been struggling combo boxes for days and would appreciate any ideas. The first combo box lists sites and the second Leases. What I am after is after selecting a site that only the leases for that site are dispalyed in the second cbo.
Form Record Source is M_ReceiptSlip
Site is defined by cboSites_IDs whose control source is ReceiptSlipSites_IDs
Row Source a query
Code:
SELECT L_Site.Site_ID,
L_Site.SiteAbbrev,
L_Site.SiteName
FROM L_Site ORDER BY [SiteName];
Bound Col 1
Col widths 0;0;1
Lease Name is defined by cboLeases_IDs whose control source is
ReceiptSlipLeases_IDs
Row Source a query
Code:
SELECT L_Lease.LeaseName,
L_Lease.LeaseSites_IDs,
L_Site.Site_ID,
L_Site.SiteName
FROM L_Site
INNER JOIN L_Lease
ON L_Site.Site_ID = L_Lease.LeaseSites_IDs
WHERE (((L_Site.SiteName)=[Forms]![F_ReceiptSlip]![cboSites_IDs]))
ORDER BY L_Lease.LeaseName;
The table L_Site has primary key Site_ID related to table L_Lease foreign key LeaseSites_IDs.
The 1st query works fine but the second returns no records.
I have tried moving the Where [Forms]![F_ReceiptSlip]![cboSites_IDs] but still get blanks. I think this reference is the problem since when I enter an actual value as the criteria records are correctly returned. I can't seem to contect it to the value in the form though.
Any suggestions greatly appreciated. Thanks