[AccessD] Query based on form AND subform

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Wed May 19 11:28:12 CDT 2010


[forms]![frmDataEntry]![frmCert_Sub].Form![Certificate Date] 

Should do it, but be sure that "frmCert_Sub" is the name of the *control* on the main form that holds the subform.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
Sent: Wednesday, May 19, 2010 12:14 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Query based on form AND subform

I'm trying to build a query, to gather info for a report...a certificate I am printing (this might sound familiar, because I was here a few weeks ago and went around it...but it is back). The certificate that should be printed is based on the students SSN, which is on the main form, and the Issue date, which is on the sub form. 
 
I get the query to work w/just the SSN, by having a SSN field and entering criteria, "[Forms]![frmDataEntry]![ssn]" but there could be many certs and it will print them all. So, I wanted to narrow it down to the current subform record as well. Along w/the previous criteria, I've entered, in the "Date Issued" field, "[forms]![frmDataEntry]![frmCert_Sub]![Certificate Date]" and "[forms]![frmCert_Sub]![Certificate Date]", neither of which works...it prompts me for the date.
 
Can someone please enlighten me on the method I'm missing?
 
Thank you in advance, because I just know one of you has the answer...you always do.
 
Thanks!
 
J Clark
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list