Parameter Values that Come from a Form

  • Thread starter Thread starter nichole
  • Start date Start date
N

nichole

I have a form where the user chooses a start date, end date, and a user
id and then I load a report based on this criteria. I am using a query
as the recordsource for my report and the parameters values in the
query come from the form. Everything works great except for one thing.


The first time I enter the criteria and try to run the report it pops
up the parameter values box and promts me for the values. BUT... if I
switch to design view and then back to form view it works every single
time after that and runs my report fine. It's just my first time
trying to run it that the query does not recognize the parameter
values.

Any suggestions are welcome.

Nichole
 
Do you have the parameters in the query in this syntax:

[Forms]![NameOfYourForm]![NameOfControlOnYourForm]
 
Yep... here is an example of one of my parameters.
[forms]![Switchboard]![txtSearchSin]

It's really strange. It works every time fine if I just switch the
form to design view then go back and run the program. And ... I only
have to do this once and I can run the report as many times as I want
and it works perfectly. It's just that very first time when I run it.
I'm totally stumped.


Do you have the parameters in the query in this syntax:

[Forms]![NameOfYourForm]![NameOfControlOnYourForm]

nichole said:
I have a form where the user chooses a start date, end date, and a user
id and then I load a report based on this criteria. I am using a query
as the recordsource for my report and the parameters values in the
query come from the form. Everything works great except for one thing.


The first time I enter the criteria and try to run the report it pops
up the parameter values box and promts me for the values. BUT... if I
switch to design view and then back to form view it works every single
time after that and runs my report fine. It's just my first time
trying to run it that the query does not recognize the parameter
values.

Any suggestions are welcome.

Nichole
 
When I try to run the query in vb code it's telling me that in the
report open sub it can't find the form where my values are but after I
switch to design view then come back it works... does anyone know what
changes take place to a form when it switches from design view then
back to form view??

Yep... here is an example of one of my parameters.
[forms]![Switchboard]![txtSearchSin]

It's really strange. It works every time fine if I just switch the
form to design view then go back and run the program. And ... I only
have to do this once and I can run the report as many times as I want
and it works perfectly. It's just that very first time when I run it.
I'm totally stumped.


Do you have the parameters in the query in this syntax:

[Forms]![NameOfYourForm]![NameOfControlOnYourForm]

nichole said:
I have a form where the user chooses a start date, end date, and a user
id and then I load a report based on this criteria. I am using a query
as the recordsource for my report and the parameters values in the
query come from the form. Everything works great except for one thing.


The first time I enter the criteria and try to run the report it pops
up the parameter values box and promts me for the values. BUT... if I
switch to design view and then back to form view it works every single
time after that and runs my report fine. It's just my first time
trying to run it that the query does not recognize the parameter
values.

Any suggestions are welcome.

Nichole
 
Back
Top