Re: Automating a query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

"Gary Walter" wrote:

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

"alex" wrote:

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.

"Gary Walter" wrote:

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






.



Relevant Pages

  • Re: Automating a query
    ... *autonumber* primary key which I tried to ... I guess I did not have the right code in for the SQL statement? ... then set index of the fieldin "test" ... "No Duplicates" ...
    (microsoft.public.access.queries)
  • Re: no duplicates on close of form
    ... Each control also had a BeforeUpdate event. ... >> to validate (including checking for duplicates) and, if necessary, ... >> Good luck ... >> Jeff Boyce ...
    (microsoft.public.access.formscoding)
  • Re: Check table for like values
    ... am looking for a way to find more than just duplicates. ... FROM tblImported INNER JOIN tblContacts ... If you are trying to do this programmatically, copy the SQL statement above ... Dim strSql As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Check table for like values
    ... am looking for a way to find more than just duplicates. ... FROM tblImported INNER JOIN tblContacts ... If you are trying to do this programmatically, copy the SQL statement above ... Dim strSql As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Dublicate Records in Combo Box
    ... >>Try this SQL statement: ... >>DISTINCTROW returns records that are unique for all ... I can't get those duplicates to go away, ...
    (microsoft.public.access.forms)