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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Input To Query Problem 1

Status
Not open for further replies.

ReportMan

Programmer
Joined
Aug 13, 2001
Messages
40
Location
US
I am having a problem getting my Query to use the SubForm value as search criteria.

I have:
Access version 2003
Mainform - Location Master Browse - Location Number
Subform - Location Account Browse SubForm - LocMast - Location Number
Query - Bank Master Browse Query - LocMast - Location Number
Results Form - Bank Master Browse Subform2 - LocMast - Loc Num

The Query is input for the Results Form. My criteria for the query is

[Forms]![Location Master Browse - Location Number]![Location Account Browse Subform - LocMast - Location Number].[Form]![ABA Routing Number]

When the Results Form is called the criteria is displayed waiting for a typed input. If I type in a valid answer the Results Form is displayed.

I have looked at this code until my eyes are crossed. Can someone see and explain what I am doing wrong. Any help would be greatly appreciated.

 
Seems that the control that contains the subform has another name than the subform.
A common way to discover the proper syntax is to follow the expression builder (loaded forms).
Have a look here too:

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I used the build function in the query to generate the criteria statement but I get the same result...
 
Obviously the form containing the subform is open and populated when the query is launched ...
 
Yes it is.. It is called thru a macro...
 
When the Results Form is called with the Query as the Data Source, Access puts up a Enter Parameter Value message box with the criteria statement shown.
 
Is "Location Master Browse - Location Number" open and populated when the Results Form is called with the Query as the Data Source ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes, that is the main form which the subform is attached to...
 
I went thru and did a saveas on every form, query and macro. Then I rebuilt the forms, queries and macros with the new names. To my utter suprise it now works. I still don't know what the problem was but it seems like it must be mis-spelling of something like that. I appreciate you help....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top