Correct field name

jason_nevin

Registered User.
Local time
Today, 08:00
Joined
Nov 22, 2002
Messages
46
I am running a report based on a query from a subform called subfrmQuote. I have setup my query so that one of the fields has a criteria of [Forms]![subfrmQuote]![QuoteNumber] . However when I run the report the query prompts me for a value for this field even though the field has a value in it and the form is current. Any ideas?
 
I've tried this but with no success unfortunately. My subform is actually part of another subform as well. I've tried [forms]![MainForm]![SubForm]![subfrmQuote]![QuoteNumber] but this doesn't seem to work either. Any ideas.
 
Try using the statement builder...

Regards
 
jason_nevin said:
I've tried this but with no success unfortunately. My subform is actually part of another subform as well. I've tried [forms]![MainForm]![SubForm]![subfrmQuote]![QuoteNumber] but this doesn't seem to work either. Any ideas.

I am a macro person so you will have change this idea to code.

I would have a macro first open the form that is the sub form in question and then hav the macro's next action to open query and that way the reference will be simple.

When you open the form that is your subform then the Where condition relating it to your main form could open the form that is your subform with the records it displays when it is open as a subform.

PS. I just tried an experiment :) I opened one of my queries from the data base window that has the criteria based on entries on a form. I then closed the form and the query sat there. I then sorted the query and all records disappeared but no messages. So you try putting a Close Form in the macro after the OpenQuery. There is no end to the time that one can waste on this stuff :D

Mike
 
Last edited:

Users who are viewing this thread

Back
Top Bottom