Using a value from a form in query criteria run from a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a subform in it. They are linked by a field OccurranceNo.
I have a combo box on the subform that has its dropdown populated by a query
with a where clause
Where tbl.OccurranceNo = forms!frmParentForm.OccuranceNo

With the form open, this query produces the expected result. However, when
it runs within the subform it produces no data and leaves the data portion
blank. If I remove the Where clause the query and combo box work as
expected, but I need the criteria for the context of the application. I
figure the problem has to be the syntax of the Where clause. Any suggestions
would be greatly appreciated.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If the Child Link Field is OccurranceNo that means it is available on
the subform, which means the WHERE clause can look like this:

WHERE tbl.OccurranceNo = Form.OccurranceNo

Make sure the column name and the control name are spelled correctly.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ+J5sYechKqOuFEgEQL4ggCffBUWEdMMq9ic0pJq1ygSVLrdnKoAoKFj
xID7nINYwDrLEmb56W/rEoO3
=ZJRo
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top