f



'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''

Hello fellow programmers,

I am trying to run an append/update query from code, a command button
on a form initiates the queries.

the format i am using is;

_____________________________________________________

SELECT "criteria"
FROM "criteria"
WHERE "criteria"
UPDATE/APPEND "field selections"

RecordSource "qryExample" = above text strings"
_______________________________________________________________________

When i am running a SELECT query in this manner it works fine with no
problems, and accepts the values of specified linked form fields.

This never works when doing an APPEND/UPDATE query. It can never find
the values of linked form fields, Access always asks for the parameter
value of the field(s) in question, or Access comes up with an error
3323 - No recordset. I am sure there are other people that have had
this problem.

What is the difference between Select queries and append/update
queries? the append/update queries never seem to be able to find
values in linked form fields.

Can anyone shed any light on this or point to a knowledgebase Item, or
even recommend a book focusing on this subject, I will go and buy it
now.

I have been for up 2 nights trying to acomplish this and now
considering suicide, please help.

Thanks In advance,

Aaron.
0
aaron6392 (8)
8/12/2004 8:12:37 AM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

1 Replies
4360 Views

Similar Articles

[PageSpeed] 15

I know of two ways you can accomplish this.

1. You can create the SQL script for you append or update query and run the
script with DoCmd.RunSQL.

2. You can create a query based on the SQL script and run the query with
<query object>.Execute.

Both ways are documented in Access Help. The first one is easier if you want
to create queries on the fly and if you do not want to save the queries
themselves.

HJ


"Aaron" <aaron@rapid-motion.co.uk> wrote in message
news:260d7f40.0408120012.1b2e110b@posting.google.com...
> Hello fellow programmers,
>
> I am trying to run an append/update query from code, a command button
> on a form initiates the queries.
>
> the format i am using is;
>
> _____________________________________________________
>
> SELECT "criteria"
> FROM "criteria"
> WHERE "criteria"
> UPDATE/APPEND "field selections"
>
> RecordSource "qryExample" = above text strings"
> _______________________________________________________________________
>
> When i am running a SELECT query in this manner it works fine with no
> problems, and accepts the values of specified linked form fields.
>
> This never works when doing an APPEND/UPDATE query. It can never find
> the values of linked form fields, Access always asks for the parameter
> value of the field(s) in question, or Access comes up with an error
> 3323 - No recordset. I am sure there are other people that have had
> this problem.
>
> What is the difference between Select queries and append/update
> queries? the append/update queries never seem to be able to find
> values in linked form fields.
>
> Can anyone shed any light on this or point to a knowledgebase Item, or
> even recommend a book focusing on this subject, I will go and buy it
> now.
>
> I have been for up 2 nights trying to acomplish this and now
> considering suicide, please help.
>
> Thanks In advance,
>
> Aaron.


0
hjiscoolno (40)
8/12/2004 9:28:02 AM
Reply: