473,725 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'''''''''''''Th e 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 3422
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.goo gle.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.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1772
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 name.
3
1828
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 value in Field9 in tblOne for all the records found by the query. I am not sure if I should use an update query or if I use some vba code. In case I will have to use an update query, is there a way to disable the warning prompts of it? (Or any...
2
396
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 as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as;
3
2144
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 stored procedures with input parameters by which they filter rows to be updated or inserted into other tables. Filtration is based on certain actual values on forms (form with several subforms). My question is following: How to pass parameters to...
0
8638
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 anyone else experiencing a similar issue. Or maybe someone can resolve this in C#........... ____________________________________________________________________________ _________________ Hi Scott, thanks a lot for your input. I did try using...
8
1319
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 classes, but one of things that I can't seem to get my head wrapped around is this: if you're given a large table that has missing and incomplete records and you want to clean that data up, (replace missing dates using the previous record and...
0
1270
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, and I'm sorry to say that I forgot how I did it. Please remind me. Thanks Ira Solomon
17
2028
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 number 1 that is the value of collumn home_id which is set to auto increment ect ect but this script which gets the id of home_id of a row and lets you edit it does not work for somereason...
14
6683
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 samples for them to review the accounts. I was making a suggestion to my team that maybe if we only ran one Cognos query and pulled in all of the columns that everyone needs to pull samples for each of there tests that this would be better on the time...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.