473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

'''''''''''''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.
Nov 13 '05 #1
1 3387
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Luca Calderano | last post by:
I MEAN YOU CAN ACCESS ADO TROUGHT COM AS EXPLAINED HERE: import win32com.client import locale from os import sys adCmdStoredProc = 4 # Evaluates CommandText as a stored procedure...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a select query which is based on tblOne and tblTwo. The query selects some of the records in tblOne and tblTwo, based on a Where condition. What I need to do is to change the...
2
by: Aaron | last post by:
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such...
3
by: Zlatko | last post by:
A question concerning Access Project with SQL Server: I use a stored procedure that is calling several other stored procedure which update or append values in several tables. All of them are...
0
by: newms | last post by:
The following thread is related to a file access problem that seems to be a C# language problem. I have temporarily resolved it with vb.net as described below and thought it might be helpful to...
8
by: Takeadoe | last post by:
Folks, I'm just now beginning to use Access. To date, I've managed hundreds of thousands of records in SAS, but would like to expand my software horizon. I've read some and sat throught some...
0
by: Ira Solomon | last post by:
Many years ago (1999) I created a front end that allowed allowed end users to write their own select queries and reports, but did not allow queries that changed any data. I want to do it again,...
17
by: so many sites so little time | last post by:
all right so the script is pretty simple it goes it retrives what the id of the post is and it lets you edit it well no it doesnt. now if you go to www.kirewire.com/pp2/index/php you will see a...
14
by: Supermansteel | last post by:
My team at work uses Cognos to run multiple queries to pull in data. Then they take that data and import into Access and then usually run an Append Query to run a RND function to pull out a few...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.