Duplicate date prompts when using Macro to run Crosstab Query

  • Thread starter VMR via AccessMonster.com
  • Start date
V

VMR via AccessMonster.com

Hello,

I am having an issue when I run a Crosstab Query via a Macro. I get prompted
for duplicate Start and End Date. This only happens when I run the Query via
Macro.

When I run the Query without using the Macro it works fine and only prompts
me once for Dates.

Does anyone know what I am doing wrong?

Please help!

VMR
 
A

Allen Browne

I can't see a valid reason why the parameters should pop up twice only when
the query is executed by macro. (What version of Access is this?)

A workaround might be to create a little unbound form with a couple of text
boxes where you enter the 2 dates, and a command button that fires the
macro. In the query, change the parameter names so they read the dates from
the form, e.g.:
[Forms].[Form1].[txtStartDate]
Then you can fill in the dates once, and if it needs to read them twice it
can without bothering you again.

Just to be sure Access understands these dates correctly, it would be wise
to:
a) Set the Format property of the unbound text boxes to General Date (so it
knows they are dates, and accepts only valid dates)

b) Declare the parameters in the query. Choose Parameters on the Query menu,
and enter 2 rows in the dialog, e.g.:
[Forms].[Form1].[txtStartDate] Date/Time
[Forms].[Form1].[txtEndDate] Date/Time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top