Group:  Microsoft Access ยป microsoft.public.access.macros
Thread: All the things in my macro are not running

All the things in my macro are not running
Kelly 12/24/2008 3:14:00 PM
I have a macro that is running 31 different append queries. When I run the
macro it gives me the key violation error on a couple of the append queries,
but when I go back and run them manually they work just fine.
Any ideas on why it's not working in the macro but it does when done manually.
~Kelly
Re: All the things in my macro are not running
"Jeff Boyce" <nonsense[ at ]nonsense.com> 12/24/2008 6:54:07 PM
Kelly

When an append query tells you that there's a key violation, it means that a
record (or many) cannot be added because it/they already exist.

I'm having trouble imagining why Access would actually add a duplicate key
record when you run the query directly, but refuse to when you run it in a
macro.

Can you confirm, after running the query "manually", that Access actually
DID add one/more duplicate-key records?

Or maybe it's the warning that's different...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Kelly" <Kelly[ at ]discussions.microsoft.com> wrote in message
news:144128DE-81F3-4B12-B3B9-37FCDB975864[ at ]microsoft.com...
[Quoted Text]
>I have a macro that is running 31 different append queries. When I run the
> macro it gives me the key violation error on a couple of the append
> queries,
> but when I go back and run them manually they work just fine.
> Any ideas on why it's not working in the macro but it does when done
> manually.
> ~Kelly


Re: All the things in my macro are not running
Kelly 12/24/2008 7:16:02 PM
It's not adding a duplicate record. It's giving me this error message when I
have nothing in the table yet. After I get the message I look at the table
to verify that nothing is in it and then manually run it and it works just
fine.
Re: All the things in my macro are not running
"Jeff Boyce" <nonsense[ at ]nonsense.com> 12/29/2008 5:40:07 PM
Kelly

OK, I'm stumped!

Have you tried tossing out the old query and creating a new one that does
the same thing? Then referring to that new query in your macro?

(sometimes the queries get subtly corrupted and it takes starting over...)

Regards

Jeff Boyce
Microsoft Office/Access MVP


"Kelly" <Kelly[ at ]discussions.microsoft.com> wrote in message
news:76F2A39F-863B-4036-919B-6D84DCE62AE8[ at ]microsoft.com...
[Quoted Text]
> It's not adding a duplicate record. It's giving me this error message
> when I
> have nothing in the table yet. After I get the message I look at the
> table
> to verify that nothing is in it and then manually run it and it works just
> fine.


Re: All the things in my macro are not running
Kelly 12/30/2008 4:13:02 PM
Ok, so I have figured it out now.
It was the order in which I had the queries running. Most of my tables have
many to many relationships so I of course have Join tables. I was trying to
add data to the Join tables before adding it to the tables it was connected
to, since I had referencial integrety set up.

Man, I'm glad I got that figured out it was driving my crazy.
Thanks for your help Jeff :-D

~Kelly

"Jeff Boyce" wrote:

[Quoted Text]
> Kelly
>
> OK, I'm stumped!
>
> Have you tried tossing out the old query and creating a new one that does
> the same thing? Then referring to that new query in your macro?
>
> (sometimes the queries get subtly corrupted and it takes starting over...)
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
>
> "Kelly" <Kelly[ at ]discussions.microsoft.com> wrote in message
> news:76F2A39F-863B-4036-919B-6D84DCE62AE8[ at ]microsoft.com...
> > It's not adding a duplicate record. It's giving me this error message
> > when I
> > have nothing in the table yet. After I get the message I look at the
> > table
> > to verify that nothing is in it and then manually run it and it works just
> > fine.
>
>
>
Re: All the things in my macro are not running
"Jeff Boyce" <nonsense[ at ]nonsense.com> 12/30/2008 4:56:16 PM
Thanks for posting back with your solution. Other folks may run into the
same kind of issue in the future and your solution may help them!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Kelly" <Kelly[ at ]discussions.microsoft.com> wrote in message
news:26243010-6891-495B-8C11-A0539051353C[ at ]microsoft.com...
[Quoted Text]
> Ok, so I have figured it out now.
> It was the order in which I had the queries running. Most of my tables
> have
> many to many relationships so I of course have Join tables. I was trying
> to
> add data to the Join tables before adding it to the tables it was
> connected
> to, since I had referencial integrety set up.
>
> Man, I'm glad I got that figured out it was driving my crazy.
> Thanks for your help Jeff :-D
>
> ~Kelly
>
> "Jeff Boyce" wrote:
>
>> Kelly
>>
>> OK, I'm stumped!
>>
>> Have you tried tossing out the old query and creating a new one that does
>> the same thing? Then referring to that new query in your macro?
>>
>> (sometimes the queries get subtly corrupted and it takes starting
>> over...)
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Office/Access MVP
>>
>>
>> "Kelly" <Kelly[ at ]discussions.microsoft.com> wrote in message
>> news:76F2A39F-863B-4036-919B-6D84DCE62AE8[ at ]microsoft.com...
>> > It's not adding a duplicate record. It's giving me this error message
>> > when I
>> > have nothing in the table yet. After I get the message I look at the
>> > table
>> > to verify that nothing is in it and then manually run it and it works
>> > just
>> > fine.
>>
>>
>>


Home | Search | Terms | Imprint
Newsgroups Reader