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

From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 02/01/04


Date: Sat, 31 Jan 2004 19:01:14 -0700

On Sun, 1 Feb 2004 00:24:48 -0000, "Keith Stein"
<ks012a2355@blueyonder.co.uk> wrote:

>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.

                  John W. Vinson[MVP]
    Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



Relevant Pages

  • Re: VBA Append Query Key Violations
    ... "Steve via AccessMonster.com" wrote in ... Does anyone know how to capture the key violation error? ... I am new to VBA... ... If you use the DAO Execute method to run your append query, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Is it possible to Change String Delimiter without using an interface Spec?
    ... VBA doesn't come into it unless you want to automate the whole process ... appends it to the new table, using calculated field with an expression ... append query" and "Create an update query". ... >> Please respond in the newgroup and not by email. ...
    (microsoft.public.access.externaldata)
  • RE: Append query fails but no error produced
    ... The only way you'll be able to accomplish that in VBA ... Microsoft Access Support ... Microsoft Security Bulletin MS03-026? ... | I have an append query running from code (see SQL statement at ...
    (microsoft.public.access.queries)
  • Inconsistent results - append query
    ... When I execute an append query in vba by the ... strSQL statement and pasted it in the SQL query design window and viewed it ... I have done this multiple times, compiled the vba code, ... compacted the database multiple times, ...
    (microsoft.public.access.queries)
  • Re: How to populate sequential numbers in a field using SQL or VBA?
    ... VBA? ... (I do not want to use append query with autonumber field.) ... Excel 009 ...
    (comp.databases.ms-access)