Hi Armen .. okay, I've got to be driving you crazy!!
That's a very short trip.
I put a command button
on the little form ... called it cmdOK ... put it your code on its 'on click'
event. When I run my report, my form does auto open (its a macro that opens
the form) and its on the 'on open' event of the report ... I choose a course
from the drop down combo box and then click OK ... now, I have a macro that
runs on the 'on no data' event with a message to let the user know that there
criteria doesn't match ... that's what comes up ... but I know I have a
record out there for that course? Probably some little thing right?
We don't use Macros in our shop, so there might be something I'm not
seeing here. We only use VBA, which is what my example shows.
However....
Does the report display only AFTER you click the OK button on the
form?
Does your form hide itself when the OK button is clicked?
Both answers have to be Yes for this to work. Otherwise your report
will try to run using criteria that you haven't actually specified
yet. As usual, timing is everything.
After your report displays "no records", try this. Use Ctrl-G to open
the Immediate Window. Type in:
?[forms]![pickcourse]![cbocourse]
(note the initial "?") and hit Enter. You should see the value that's
in the combobox on your form. Does it make sense as a criteria for
your query? Is it possible that it's showing the *name* of your
course instead of the *ID* of your course? If so, then the bound
column of your combobox is incorrect.
Armen Stein
Microsoft Access MVP
www.JStreetTech.com