By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
HJ
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" <aa***@rapid-motion.co.uk> wrote in message
news:26**************************@posting.google.c om...
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.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.