Report from a Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that On Open opens a form from which the user selects a name
from a dropdown box, then what should happen is the query runs, populates the
report and I'm done...

Problem, It doesn't work. The from pops up perfect when I open the report,
but I get an error instead of the report that says the record souce doesn't
exist.

If I open the form, select a name, then open the query everything is fine.
Somehow the report isn't connecting to the query.

Here is the SQL that I have in the On Open of the report:

DoCmd.OpenForm "frmQueryforTeamLeaderreport", , , , , acDialog
Me.RecordSource = Forms![frmQueryforTeamLeaderreport]![Text14]
DoCmd.Close acForm, "frmQueryforTeamLeaderreport"

I've looked up other threads and havne't found anything to help.
Any assistance will be very much appreciated.
thanks
 
AJ,
You should open your form first, get the input data from the user, then
open the report from that form. The query of the report can look to the
open form for it's criteria values.
Ex. criteria...
= Forms!frmYourDialogForm!YourFieldname!
hth
Al Camp
 
thanks

AlCamp said:
AJ,
You should open your form first, get the input data from the user, then
open the report from that form. The query of the report can look to the
open form for it's criteria values.
Ex. criteria...
= Forms!frmYourDialogForm!YourFieldname!
hth
Al Camp

AJ said:
I have a report that On Open opens a form from which the user selects a
name
from a dropdown box, then what should happen is the query runs, populates
the
report and I'm done...

Problem, It doesn't work. The from pops up perfect when I open the
report,
but I get an error instead of the report that says the record souce
doesn't
exist.

If I open the form, select a name, then open the query everything is fine.
Somehow the report isn't connecting to the query.

Here is the SQL that I have in the On Open of the report:

DoCmd.OpenForm "frmQueryforTeamLeaderreport", , , , , acDialog
Me.RecordSource = Forms![frmQueryforTeamLeaderreport]![Text14]
DoCmd.Close acForm, "frmQueryforTeamLeaderreport"

I've looked up other threads and havne't found anything to help.
Any assistance will be very much appreciated.
thanks
 
Back
Top