Form/subform query that does not recognize subform entry.

G

Guest

I am trying to query a database with the criteria of a Main form and subform.
It will not take the ((DB2MAST_IVDETKBT.IKB_PART_NUM)=[Forms]![F: Error
Entry Sub]![Part Ordered])); for some reason. It continually asks me to
enter the data like a pop up entry box. I need to get it to pull from its
form box. This is what I have.

SELECT DB2MAST_IVDETKBT.IKB_QTY_SHIPPED
FROM DB2MAST_IVDETKBT
WHERE (((DB2MAST_IVDETKBT.IKB_INVOICE_NUM)=[Forms]![F: Error Entry]![Invoice
Number]) AND ((DB2MAST_IVDETKBT.IKB_PART_NUM)=[Forms]![F: Error Entry
Sub]![Part Ordered]));
 
D

Duane Hookom

Make sure the form is open and use syntax like:
Forms!frmMain!subformcontrol!Form!ControlName
 
G

Guest

Thanks.
For those of you who like to know, here is what the final looked like.
SELECT DB2MAST_IVDETKBT.IKB_QTY_SHIPPED
FROM DB2MAST_IVDETKBT
WHERE (((DB2MAST_IVDETKBT.IKB_INVOICE_NUM)=[Forms]![F: Error Entry]![Invoice
Number]) AND ((DB2MAST_IVDETKBT.IKB_PART_NUM)=[Forms]![F: Error Entry]![Error
Entry SubForm].[Form]![Part Ordered]));


Duane Hookom said:
Make sure the form is open and use syntax like:
Forms!frmMain!subformcontrol!Form!ControlName

--
Duane Hookom
MS Access MVP
--

James Kendall said:
I am trying to query a database with the criteria of a Main form and
subform.
It will not take the ((DB2MAST_IVDETKBT.IKB_PART_NUM)=[Forms]![F: Error
Entry Sub]![Part Ordered])); for some reason. It continually asks me to
enter the data like a pop up entry box. I need to get it to pull from its
form box. This is what I have.

SELECT DB2MAST_IVDETKBT.IKB_QTY_SHIPPED
FROM DB2MAST_IVDETKBT
WHERE (((DB2MAST_IVDETKBT.IKB_INVOICE_NUM)=[Forms]![F: Error
Entry]![Invoice
Number]) AND ((DB2MAST_IVDETKBT.IKB_PART_NUM)=[Forms]![F: Error Entry
Sub]![Part Ordered]));
 

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

Top