John,
When you say [Forms]![Main Form]![Subform].[Form]![ticket number], I assume
you do not actually have a form named 'Main Form' and a subform named
'Subform'? That the names of the form and subform are different. Can you
tell what you actually have? The name of the subform on the main form is
not necessarily the same as the name of the form that is embedded in the
subform, if you catch the distinction. If these names are different, it is
the name of the subform control that is needed in the expression.
Similarly, the name of the textbox on the form may not necessarily be the
same as the name of the field it is bound to. If they are different, I
think you need the name of the textbox control. So, is the field actually
named 'ticket number'? if so, is the name of the textbox on the form also
named 'ticket number'?
Also, when you say "I test this from the query", do you mean that the form
is open at the time?
--
Steve Schapel, Microsoft Access MVP
john said:
Steve, Thanks for you help but for some reason it's not working. This is
what I have in the query:
[Forms]![Main Form]![Subform].[Form]![ticket number]
When I test this from the query it asks for the ticket number. When I
test
it from the from that even has old records it still asks for the ticket
number. I tried it your way and it did the same thing.
Any suggestions?
Steve Schapel said:
John,
Ah, here's another thought... If this is a newly entered record on the
form, you may need to explicitly save it before the query will work, as
it
doesn't actually exist in the table until it is saved.
--
Steve Schapel, Microsoft Access MVP
Thanks for the info but it dosen't seem to be working. The report is
blank.
If I run the query stand alone it asks for the ticket number and
everything
works but when I have the form open and run the query it just comes up
blank.
:
John,
Yes. In the query that the reports are based on, enter the equivalent
of
the following in the Criteria of the ticket number field:
[Forms]![NameOfYourForm]![Ticket Number]
.
.