1

I have a mail merge query in Access 2010 that asks for the date then it bases the records to merge by that date. When I press the query, it prompts a box to put in a date. Most of my queries are based on today's date so I find myself typing in today's date in the query box often. I would like the query prompt to show today's date and wait for me to either press OK or I could change the date in the prompt box then it will select those records based on the query date. enter image description here

enter image description here

If I do the following as shown in the image, I will get today's date but if I put yesterday's date in, I get both merged documents keyed off the 2 dates. How can I make this work? enter image description here

George
  • 95
  • 1
  • 10

1 Answers1

2

The problem here is that the dialog you are getting is for a missing parameter. It's a nice trick to be able to fill in parameter this way, but you unfortunately can't interact with the dialog box in that manner.

You're correct that by listing both the Date() function and the [Enter Letter Date] parameter you get both. This is because it's an OR clause.

One way to solve this problem would be to build a form which captures the date first. Then you could prefill the textbox on the form with the Date() function.

With a command button on the form, you could then launch the mail merge or the query.

Your query could then changed to refer to the value on the form, instead of the value entered in the dialog, such as =Forms!MailMergeFormYouCreate!LetterDatetextBox

D. Bachen
  • 178
  • 6