Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubForm Query

Status
Not open for further replies.

L0stAngel

Programmer
May 5, 2005
58
US
Hello, I have a form that has a subform on it. When I push a cmdButton on the subform, it opens a report. This report is tied to a query in which it gets data WHERE MunID = subform.txtMunID.text...how can I put this WHERE statement in a query? I've tried
Code:
WHERE MUNID = [forms]![subform]![txtMunID]
but it always shows a popup when the report opens asking for what [forms]![subform]![txtMunID] is. But, if I don't go through the main form, and just open the subform and push the cmdbutton..everything works good. This makes me think it has something to do with being a subform in a normal form...
 
Hi
A subform reference usually looks something like:
Forms![MyFormName]![MySubformName]!MyField

PS I am not sure if this has been posted in the right forum, you could look in the Access Forms Forum. :)
 
WHERE MUNID = [Forms]![main form]![subform control].Form![txtMunID]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top