Automating a query

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

Guest

Hi all

Is there a way to run a saved query like we can run a macro
(docmd.runmacro)from within a VB sub?

Thanks
 
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It goes
through its paces as if its doing something yet no results. But when I run
the Qury itself it works fine. So I the code is fine. Where' my problem??

Thanks
 
Alex said:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It
goes
through its paces as if its doing something yet no results. But when I run
the Qury itself it works fine. So I the code is fine. Where' my problem??

Thanks

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Gary

The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


Gary Walter said:
Alex said:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It
goes
through its paces as if its doing something yet no results. But when I run
the Qury itself it works fine. So I the code is fine. Where' my problem??

Thanks

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Alex,

Any reason why query name has only
one "e" for "Employee" ?

do you get any error messages?

for an action query, this is how I would do it
(for what its worth)

--make sure have Reference to DAO library.

-- then I would remove any spaces from the
query name
(actually, probably change query name to
"qryappArchiveEmpVacations")

here be code line then:

CurrentDb.Execute "qryappArchiveEmpVacations", dbFailOnError


Alex said:
The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the
code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON
Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


Gary Walter said:
Alex said:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It
goes
through its paces as if its doing something yet no results. But when I
run
the Qury itself it works fine. So I the code is fine. Where' my
problem??

Thanks
--
Alex


:


Hi Alex

Use:

DoCmd.OpenQuery "yourQuery"

Rgds

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Alex,

BTW, the last part of your WHERE
clause is redundant since condition
already in JOIN.

one other way:

Dim strSQL As String

strSQL = "INSERT INTO ArchiveEmployeeVacations " _
& "SELECT EmployeeVacations.* " _
& "FROM Employees INNER JOIN " _
& "(EmployeeVacations INNER JOIN [Temporary] " _
& "ON EmployeeVacations.EmployeeID = [Temporary].EmployeeID) " _
& "ON Employees.EmployeeID = EmployeeVacations.EmployeeID " _
& "WHERE EmployeeVacations.[From] <= Employees.[archivecalcdate];"
CurrentDb.Execute strSQL, dbFailOnError


Alex said:
The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the
code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON
Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


Gary Walter said:
Alex said:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It
goes
through its paces as if its doing something yet no results. But when I
run
the Qury itself it works fine. So I the code is fine. Where' my
problem??

Thanks
--
Alex


:


Hi Alex

Use:

DoCmd.OpenQuery "yourQuery"

Rgds

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Gary

I am not very familiar with how to do your 1st suggestion so i opted for the
2nd. I basicaly cut and paste it into my code. No Error and no results (no
appending). I might be asking a lot from yo but you possibly help some more?

thanks
--
Alex


Gary Walter said:
Hi Alex,

BTW, the last part of your WHERE
clause is redundant since condition
already in JOIN.

one other way:

Dim strSQL As String

strSQL = "INSERT INTO ArchiveEmployeeVacations " _
& "SELECT EmployeeVacations.* " _
& "FROM Employees INNER JOIN " _
& "(EmployeeVacations INNER JOIN [Temporary] " _
& "ON EmployeeVacations.EmployeeID = [Temporary].EmployeeID) " _
& "ON Employees.EmployeeID = EmployeeVacations.EmployeeID " _
& "WHERE EmployeeVacations.[From] <= Employees.[archivecalcdate];"
CurrentDb.Execute strSQL, dbFailOnError


Alex said:
The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the
code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON
Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


Gary Walter said:
:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It
goes
through its paces as if its doing something yet no results. But when I
run
the Qury itself it works fine. So I the code is fine. Where' my
problem??

Thanks
--
Alex


:


Hi Alex

Use:

DoCmd.OpenQuery "yourQuery"

Rgds

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Gary

As a test I created a new query called test that contains the following code
and ran a docmd.runquery and it worked.

SELECT EmployeeVacations.*
FROM EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID;

that tells me that there is something wrong with how VB see the other
statement. Am I on the right track?

thanks
--
Alex


Gary Walter said:
Hi Alex,

BTW, the last part of your WHERE
clause is redundant since condition
already in JOIN.

one other way:

Dim strSQL As String

strSQL = "INSERT INTO ArchiveEmployeeVacations " _
& "SELECT EmployeeVacations.* " _
& "FROM Employees INNER JOIN " _
& "(EmployeeVacations INNER JOIN [Temporary] " _
& "ON EmployeeVacations.EmployeeID = [Temporary].EmployeeID) " _
& "ON Employees.EmployeeID = EmployeeVacations.EmployeeID " _
& "WHERE EmployeeVacations.[From] <= Employees.[archivecalcdate];"
CurrentDb.Execute strSQL, dbFailOnError


Alex said:
The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the
code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON
Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


Gary Walter said:
:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work. It
goes
through its paces as if its doing something yet no results. But when I
run
the Qury itself it works fine. So I the code is fine. Where' my
problem??

Thanks
--
Alex


:


Hi Alex

Use:

DoCmd.OpenQuery "yourQuery"

Rgds

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Alex,

There are a few things that come to mind.

CurrentDb.Execute executes "silently,"
i.e., there will be no warning message that you are
about to append some data to a table.

(the only message you will see is if the query fails
in some fashion)

This includes not showing the message that so many
records could not be appended because of violation
of indexes (I believe....but could be wrong).

So...if the table to which you are appending the records
has any "no-dup-type" indexes, then duplicate records
will not be appended "silently."

I know this may be silly to ask, but if you've run the query
previously, are you sure *more* records should be appended
when you run the same query again?

I suppose a simple test would be to start with an empty
table and run the code.

I mean no offense by suggesting the obvious.

good luck,

gary


Alex said:
I am not very familiar with how to do your 1st suggestion so i opted for
the
2nd. I basicaly cut and paste it into my code. No Error and no results (no
appending). I might be asking a lot from yo but you possibly help some
more?

thanks
--
Alex


Gary Walter said:
Hi Alex,

BTW, the last part of your WHERE
clause is redundant since condition
already in JOIN.

one other way:

Dim strSQL As String

strSQL = "INSERT INTO ArchiveEmployeeVacations " _
& "SELECT EmployeeVacations.* " _
& "FROM Employees INNER JOIN " _
& "(EmployeeVacations INNER JOIN [Temporary] " _
& "ON EmployeeVacations.EmployeeID = [Temporary].EmployeeID) " _
& "ON Employees.EmployeeID = EmployeeVacations.EmployeeID " _
& "WHERE EmployeeVacations.[From] <= Employees.[archivecalcdate];"
CurrentDb.Execute strSQL, dbFailOnError


Alex said:
The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the
code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON
Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


:


:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work.
It
goes
through its paces as if its doing something yet no results. But when
I
run
the Qury itself it works fine. So I the code is fine. Where' my
problem??

Thanks
--
Alex


:


Hi Alex

Use:

DoCmd.OpenQuery "yourQuery"

Rgds

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Gary

No question is silly as we both know. I run the Query by itself and
everything works. The appended records cannot have a duplicate key since they
are comming from a table that has the auto number as the key for EmployeeID.
I have run it with an empty table and the records are appended properly when
run through the query not VB code. Like I mentioned in the other post when I
run a simpler query the VB code accepts and runs it. There seems to be
something wrong with how it's ready the INNER JOINS. I am flat out stumped.

Thanks

Gary Walter said:
Hi Alex,

There are a few things that come to mind.

CurrentDb.Execute executes "silently,"
i.e., there will be no warning message that you are
about to append some data to a table.

(the only message you will see is if the query fails
in some fashion)

This includes not showing the message that so many
records could not be appended because of violation
of indexes (I believe....but could be wrong).

So...if the table to which you are appending the records
has any "no-dup-type" indexes, then duplicate records
will not be appended "silently."

I know this may be silly to ask, but if you've run the query
previously, are you sure *more* records should be appended
when you run the same query again?

I suppose a simple test would be to start with an empty
table and run the code.

I mean no offense by suggesting the obvious.

good luck,

gary


Alex said:
I am not very familiar with how to do your 1st suggestion so i opted for
the
2nd. I basicaly cut and paste it into my code. No Error and no results (no
appending). I might be asking a lot from yo but you possibly help some
more?

thanks
--
Alex


Gary Walter said:
Hi Alex,

BTW, the last part of your WHERE
clause is redundant since condition
already in JOIN.

one other way:

Dim strSQL As String

strSQL = "INSERT INTO ArchiveEmployeeVacations " _
& "SELECT EmployeeVacations.* " _
& "FROM Employees INNER JOIN " _
& "(EmployeeVacations INNER JOIN [Temporary] " _
& "ON EmployeeVacations.EmployeeID = [Temporary].EmployeeID) " _
& "ON Employees.EmployeeID = EmployeeVacations.EmployeeID " _
& "WHERE EmployeeVacations.[From] <= Employees.[archivecalcdate];"
CurrentDb.Execute strSQL, dbFailOnError


:

The brakets did not work. The saved query is called "Append To
ArchiveEmployeVacations". The Query is an Append to a table. Here's the
code:

INSERT INTO ArchiveEmployeeVacations
SELECT EmployeeVacations.*
FROM Employees INNER JOIN (EmployeeVacations INNER JOIN [Temporary] ON
EmployeeVacations.EmployeeID = Temporary.EmployeeID) ON
Employees.EmployeeID
= EmployeeVacations.EmployeeID
WHERE (((EmployeeVacations.From)<=([employees].[archivecalcdate])) AND
((EmployeeVacations.EmployeeID)=[employees].[employeeid]));

When run alne it works fine and returns results in the appended table.

Thanks
--
Alex


:


:
Hi Dave

Thanks but didn't work I tried the DoCmd.RunSQL and it didn't work.
It
goes
through its paces as if its doing something yet no results. But when
I
run
the Qury itself it works fine. So I the code is fine. Where' my
problem??

Thanks
--
Alex


:


Hi Alex

Use:

DoCmd.OpenQuery "yourQuery"

Rgds

Hi Alex,

..RunSQL requires an "action" query
(or a data-definition query).

Does your saved query return rows?

-- then OpenQuery should work

Some gotchas are:

1) query name with spaces must be enclosed
with brackets

DoCmd.OpenQuery "[Sales Totals Query]"

2) a query that references controls on a form
will not work for .RunSQL (and maybe .OpenQuery)

If this does not help, please post
name and sql of stored query.

Thanks,

gary
 
Hi Alex,

Just to be sure....
I wasn't concerned about indexing
on table the records were "coming from,"
but indexing on table the records were
"going to" (ArchiveEmployeeVacations).

When you show "ArchiveEmployeeVacations"
in design mode, and click on Indexes,
what do you see?

You should not have an Autonumber field
in "ArchiveEmployeeVacations" if the field
is coming from append. Does that make
sense to you? Once you have appended
records that "use up" the primary key autonumber to
say "1200," even though you delete records
"100-1200," doesn't the pk autonumber field expect
the next append record to be "1201" but
you are trying to append record "100."

Would you mind trying something?

Make a copy of EmployeeVacations
(structure only) and name it "test"

Change any "AutoNumber" fields to Long.

Go into Indexes and remove all.

Start a new query.

Add your 3 tables.

Set your Join lines.

Right-mouse click on EmployeeVacations,
choose "Properties," and change "Alias" to "EV"

Right-mouse click on Employees,
choose "Properties," and change "Alias" to "E"

Right-mouse click on Temporary,
choose "Properties," and change "Alias" to "T"

Double-click at top of EV table
which should select all its fields,
then drap-and-drop the selected
fields down to grid.

Go to top menu and change query
to "Append" to your new table "test"

All the fields in the grid should match up.

Go to SQL View and copy this sql.

Start your code like following:

Dim strSQL As String

strSQL = " "
CurrentDb.Execute strSQL, dbFailOnError

Then paste sql you just copied to the clipboard
in between the 2 quotes.

Clean code up by

1) pick a point in string (after a space) at the right where
you want the line to break.
2) type in
" _ <ENTER>
3) tab next line over and type
& "
4) lather, rinse, repeat
5) make sure always end with a space at right
of a line segment.

....... xxxx " _

Save code, run Debug to double check,
then run event.

Does this work?

good luck,

gary
 
I forgot to ask you to set
the Criteria....

plus... you should be able
to just keep running code
and *more records* will be
appended.

If you delete all the records in "test,"
then set index of the field(s) in "test"
that were your primary key
in the original table to

"No Duplicates"

then the code should stop
adding duplicates (silently).

good luck,

gary
 
Gary

What a pain!! Your idea worked like a charm and I am receiving the results I
need. I guess I did not have the right code in for the SQL statement? All I
have to do now is set the proper criteria and repeat the process for 5 more
queries.

Tell me something though why would the query work in Access and not in a VB
statement?

If you don't have time I understand. But all he same thanks a bunch.
 
Hi Alex,

Best guess is that your original "appendto"
table (ArchiveEmployeeVacations) had an
*autonumber* primary key which I tried to
explain earlier.

Was that the case?

Do I need to explain that better?

good luck,

gary
 
Hey Gary

Beswering you I decided to revert the EV tabe to "auto Numer" and tried the
script in VB. Guess what it worked fine. So it must be something to do with
how VB reads the SQL command.

If you're up to it, my criteria is not working. This is the line I'm using:
& "WHERE (((EV.EmployeeID)=[T].[EmployeeID]) AND
((EV.From)<=([E].[ArchiveCalcDate])));"

If you're too busy I'll keep trying for a few months.:)

Thanks
 
Hi Alex,

So you changed the field to autonumber and
index of no-dups, deleted some of the records,
then retried it and it worked?

"From" is a reserved name in Access,
did you try criteria with "From" in brackets?

good luck,

gary

alex said:
Beswering you I decided to revert the EV tabe to "auto Numer" and tried
the
script in VB. Guess what it worked fine. So it must be something to do
with
how VB reads the SQL command.

If you're up to it, my criteria is not working. This is the line I'm
using:
& "WHERE (((EV.EmployeeID)=[T].[EmployeeID]) AND
((EV.From)<=([E].[ArchiveCalcDate])));"

If you're too busy I'll keep trying for a few months.:)

Thanks

Gary Walter said:
Hi Alex,

Best guess is that your original "appendto"
table (ArchiveEmployeeVacations) had an
*autonumber* primary key which I tried to
explain earlier.

Was that the case?

Do I need to explain that better?

good luck,

gary
 
The only other thing might be
that before you were using "*"
for all the table fields, and your new
sql in code now lays out those
fields explicitly.

But I just had a sense that you
ran a query in query designer
that appended a specific set of
records to your table,
you deleted those records from
the append table and tried to run
sql in code which "did not work."

I don't recall if you said you then went back
to query designer and reran query and
it still "worked."

If it was a case of a primary key/autonumber
in the append table, then the second time
you ran from query designer would not
have "worked" I guess.



alex said:
Beswering you I decided to revert the EV tabe to "auto Numer" and tried
the
script in VB. Guess what it worked fine. So it must be something to do
with
how VB reads the SQL command.

If you're up to it, my criteria is not working. This is the line I'm
using:
& "WHERE (((EV.EmployeeID)=[T].[EmployeeID]) AND
((EV.From)<=([E].[ArchiveCalcDate])));"

If you're too busy I'll keep trying for a few months.:)

Thanks

Gary Walter said:
Hi Alex,

Best guess is that your original "appendto"
table (ArchiveEmployeeVacations) had an
*autonumber* primary key which I tried to
explain earlier.

Was that the case?

Do I need to explain that better?

good luck,

gary
 
Hi Gary

Sorry for taking so long to post a thanks. I finaly got the query to work
through a macro called from VB. Ran into another problem that I have posted
seperately under "Frustrating query"

Thanks for everything

Gary Walter said:
The only other thing might be
that before you were using "*"
for all the table fields, and your new
sql in code now lays out those
fields explicitly.

But I just had a sense that you
ran a query in query designer
that appended a specific set of
records to your table,
you deleted those records from
the append table and tried to run
sql in code which "did not work."

I don't recall if you said you then went back
to query designer and reran query and
it still "worked."

If it was a case of a primary key/autonumber
in the append table, then the second time
you ran from query designer would not
have "worked" I guess.



alex said:
Beswering you I decided to revert the EV tabe to "auto Numer" and tried
the
script in VB. Guess what it worked fine. So it must be something to do
with
how VB reads the SQL command.

If you're up to it, my criteria is not working. This is the line I'm
using:
& "WHERE (((EV.EmployeeID)=[T].[EmployeeID]) AND
((EV.From)<=([E].[ArchiveCalcDate])));"

If you're too busy I'll keep trying for a few months.:)

Thanks

Gary Walter said:
Hi Alex,

Best guess is that your original "appendto"
table (ArchiveEmployeeVacations) had an
*autonumber* primary key which I tried to
explain earlier.

Was that the case?

Do I need to explain that better?

good luck,

gary

:

What a pain!! Your idea worked like a charm and I am receiving the
results
I
need. I guess I did not have the right code in for the SQL statement?
All
I
have to do now is set the proper criteria and repeat the process for 5
more
queries.

Tell me something though why would the query work in Access and not in
a
VB
statement?

If you don't have time I understand. But all he same thanks a bunch.

:

I forgot to ask you to set
the Criteria....

plus... you should be able
to just keep running code
and *more records* will be
appended.

If you delete all the records in "test,"
then set index of the field(s) in "test"
that were your primary key
in the original table to

"No Duplicates"

then the code should stop
adding duplicates (silently).

good luck,

gary
 
Back
Top