Parameter forms pop up

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

Guest

I am using Access 97. On my database I have a print switchboard with unbound
controls for putting in the start dates and end dates to filter my data by
date range. These are "tied" to queries which are used to filter the reports
I want to print. The problem is that when I open any form on the database, a
box pops up asking to input the first date. If I click "OK" (without putting
in any data) it disappears and a similar box comes up asking for the second
date in the range. If instead I just click "Cancel" on the first date box, it
disappears and the second box does not come up. Whether I click OK or Cancel,
the form opens as it should, so it doesn't impair the use of the form. I
just can't figure out why the input messages pop up and how to make them
stop! I've done many databases with similar setups and never had this
problem before, so I'm stumped! I may not be seeing the forest for the
trees...it's probably right in front of me, but I can't see it. Any ideas
out there?
 
Susan,

Sorry, but that is the way Access queries work. If you want more control
over the situation, you will need to use VBA or a macro to present either a
pop up form or input boxes to accept and validate the dates, then call the
queries using the dates entered as parameters.

Susan said:
In the query, for "start date" field I put in the criteria line "Between
[Forms]![Switchboard]![Beginning Date] And [Forms]![Switchboard]![Ending
Date]" (without the quotes). The title of the boxes that pop up is "Enter
parameter value", with a space to enter the beginning date or ending date,
depending on which box it is. I don't know any code, so I do everything the
"hard way."

Klatuu said:
Susan,
Post the code that pops up the boxes. Can't tell without see it.
 
OK...thanks. I'll dig a little deeper.

Klatuu said:
Susan,

Sorry, but that is the way Access queries work. If you want more control
over the situation, you will need to use VBA or a macro to present either a
pop up form or input boxes to accept and validate the dates, then call the
queries using the dates entered as parameters.

Susan said:
In the query, for "start date" field I put in the criteria line "Between
[Forms]![Switchboard]![Beginning Date] And [Forms]![Switchboard]![Ending
Date]" (without the quotes). The title of the boxes that pop up is "Enter
parameter value", with a space to enter the beginning date or ending date,
depending on which box it is. I don't know any code, so I do everything the
"hard way."

Klatuu said:
Susan,
Post the code that pops up the boxes. Can't tell without see it.

:

I am using Access 97. On my database I have a print switchboard with unbound
controls for putting in the start dates and end dates to filter my data by
date range. These are "tied" to queries which are used to filter the reports
I want to print. The problem is that when I open any form on the database, a
box pops up asking to input the first date. If I click "OK" (without putting
in any data) it disappears and a similar box comes up asking for the second
date in the range. If instead I just click "Cancel" on the first date box, it
disappears and the second box does not come up. Whether I click OK or Cancel,
the form opens as it should, so it doesn't impair the use of the form. I
just can't figure out why the input messages pop up and how to make them
stop! I've done many databases with similar setups and never had this
problem before, so I'm stumped! I may not be seeing the forest for the
trees...it's probably right in front of me, but I can't see it. Any ideas
out there?
 
In the query, for "start date" field I put in the criteria line "Between
[Forms]![Switchboard]![Beginning Date] And [Forms]![Switchboard]![Ending
Date]" (without the quotes). The title of the boxes that pop up is "Enter
parameter value", with a space to enter the beginning date or ending date,
depending on which box it is. I don't know any code, so I do everything the
"hard way."
 
Bruce - I deleted and re-did all the date fields on both the queries and the
form, and now it works...who know what I did wrong the first time! By the
way, none of the fields was named "Date". Thanks for your (and Klatuu's)
response!

BruceM said:
A few suggestions: Check the query in design view to be sure there are no
extra fields (columns). Be sure that every column either corresponds to a
field or is a calculated field you want to keep. Delete the Date field from
the query (the one to which you want to apply the criteria), and create a new
Date field, adding the criteria as needed. Be sure the switchboard remains
open at least until the form is open. If the text boxes referenced in the
query are on the switchboard, and the switchboard is closed, the criteria
will be meaningless. By the way, if a field is named "Date" you should try
changing the name. Date is a reserved word, and could lead to difficulties
if you use it as a field name. Be sure the unbound text boxes on the
switchboard are formatted for date.
Are you applying the criteria to a single field, in order to find just the
records for which a date field is within the criteria you specify? For
instance, the field could be SalesDate, and you are looking for all sales
last month.
If still no luck, what exactly appears in the criteria prompt? Is it asking
for [Forms]![Switchboard] etc. or for something else?

Susan said:
OK...thanks. I'll dig a little deeper.

Klatuu said:
Susan,

Sorry, but that is the way Access queries work. If you want more control
over the situation, you will need to use VBA or a macro to present either a
pop up form or input boxes to accept and validate the dates, then call the
queries using the dates entered as parameters.

:

In the query, for "start date" field I put in the criteria line "Between
[Forms]![Switchboard]![Beginning Date] And [Forms]![Switchboard]![Ending
Date]" (without the quotes). The title of the boxes that pop up is "Enter
parameter value", with a space to enter the beginning date or ending date,
depending on which box it is. I don't know any code, so I do everything the
"hard way."

:

Susan,
Post the code that pops up the boxes. Can't tell without see it.

:

I am using Access 97. On my database I have a print switchboard with unbound
controls for putting in the start dates and end dates to filter my data by
date range. These are "tied" to queries which are used to filter the reports
I want to print. The problem is that when I open any form on the database, a
box pops up asking to input the first date. If I click "OK" (without putting
in any data) it disappears and a similar box comes up asking for the second
date in the range. If instead I just click "Cancel" on the first date box, it
disappears and the second box does not come up. Whether I click OK or Cancel,
the form opens as it should, so it doesn't impair the use of the form. I
just can't figure out why the input messages pop up and how to make them
stop! I've done many databases with similar setups and never had this
problem before, so I'm stumped! I may not be seeing the forest for the
trees...it's probably right in front of me, but I can't see it. Any ideas
out there?
 
Back
Top