Help please:-Passing parameters to a query from a module

  • Thread starter Thread starter Keith Stein
  • Start date Start date
K

Keith Stein

Hi,

I don't know any VBA but need to pass a range of dates to an append query.

The query has a parameter "matchdate" and i need to run the append query
each time for a speified date.

All i want to do is something like:

matchdate = #17/1/04#
run append query
matchdate=matchdate +1

Loop until matchdate = #25/12/04#

Can someone please give me a simple bit of code!

Many Thanks

Rob
 
Hi,

I don't know any VBA but need to pass a range of dates to an append query.

The query has a parameter "matchdate" and i need to run the append query
each time for a speified date.

All i want to do is something like:

matchdate = #17/1/04#
run append query
matchdate=matchdate +1

Loop until matchdate = #25/12/04#

Can someone please give me a simple bit of code!

No code and no loop is needed.

Instead, create a small table with one date/time field; fill it with
all the dates in the desired range (you can do this quickly in Excel).
Include this table in your Append query with no join line, so that the
date is included on every row.

NOTE: Date literals in Access MUST be in either mm/dd/yy or an
unambiguous format (such as 17-Jan-2004). Day/month/year dates *WILL*
be misinterpreted.
 
Back
Top