473,749 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read specific field of specific record

I'm attempting to build a module that will allow me to update one field of a
record (using a value from a previous record) based on the value of another
field in the same record. I can successfully "cycle" through the records
one at a time and get to the appropriate field as well, but any attempt to
read the field values (using SELECT, of DoCmd.RunSQL "SELECT.... ) result in
errors.

I've searched the help file and this newsgroup but haven't found an answer.

Any help greatly appreciated.

Thanx

Chuck
Nov 12 '05 #1
4 5500
Currentdb.execu te "Update mytable set myfield = " & mystoredvalue & "where
MyIDfield = somevalue", dbfailonerror

It may need more/less quotes depending on datatypes.

Regards

Peter Russell
Chuck previously wrote:
I'm attempting to build a module that will allow me to update one field
of a
record (using a value from a previous record) based on the value of
another
field in the same record. I can successfully "cycle" through the
records
one at a time and get to the appropriate field as well, but any attempt
to
read the field values (using SELECT, of DoCmd.RunSQL "SELECT.... )
result in
errors.

I've searched the help file and this newsgroup but haven't found an
answer.

Any help greatly appreciated.

Thanx

Chuck


Nov 12 '05 #2
Why a module and not an update query? It's usually easier just to design
such a query in the design grid, and then if you need to have it run in a
module paste the SQL text in. Jet will cycle through records much faster
than VBA.
"Chuck" <b2******@aol.c om> wrote in message
news:Hn******** @news.boeing.co m...
I'm attempting to build a module that will allow me to update one field of a record (using a value from a previous record) based on the value of another field in the same record. I can successfully "cycle" through the records
one at a time and get to the appropriate field as well, but any attempt to
read the field values (using SELECT, of DoCmd.RunSQL "SELECT.... ) result in errors.

I've searched the help file and this newsgroup but haven't found an answer.
Any help greatly appreciated.

Thanx

Chuck

Nov 12 '05 #3
Thanx Peter,
This gets me part way there (at least in terms of my understanding). I
still don't know how to "remember" the value from a previous record
(mystoredvalue in your sample).

Taking baby steps, I guess...

Thanx again
Chuck

"Peter Russell" <ru***@127.0.0. 1> wrote in message
news:me******** **************@ russellscott.bt internet.com...
Currentdb.execu te "Update mytable set myfield = " & mystoredvalue & "where
MyIDfield = somevalue", dbfailonerror

It may need more/less quotes depending on datatypes.

Regards

Peter Russell
Chuck previously wrote:
I'm attempting to build a module that will allow me to update one field
of a
record (using a value from a previous record) based on the value of
another
field in the same record. I can successfully "cycle" through the
records
one at a time and get to the appropriate field as well, but any attempt
to
read the field values (using SELECT, of DoCmd.RunSQL "SELECT.... )
result in
errors.

I've searched the help file and this newsgroup but haven't found an
answer.

Any help greatly appreciated.

Thanx

Chuck

Nov 12 '05 #4
Good question. I didn't know I could store a previous record's value for
use in updating a subsequent record within an update query. I'll have to
see how to make that happen.

Thanx much

Chuck

"Bruce Rusk" <ho**********@s pamless.ucla.ed u> wrote in message
news:bn******** **@gladiola.noc .ucla.edu...
Why a module and not an update query? It's usually easier just to design
such a query in the design grid, and then if you need to have it run in a
module paste the SQL text in. Jet will cycle through records much faster
than VBA.
"Chuck" <b2******@aol.c om> wrote in message
news:Hn******** @news.boeing.co m...
I'm attempting to build a module that will allow me to update one field of
a
record (using a value from a previous record) based on the value of

another
field in the same record. I can successfully "cycle" through the

records one at a time and get to the appropriate field as well, but any attempt to read the field values (using SELECT, of DoCmd.RunSQL "SELECT.... ) result

in
errors.

I've searched the help file and this newsgroup but haven't found an

answer.

Any help greatly appreciated.

Thanx

Chuck


Nov 12 '05 #5

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

Similar topics

5
3110
by: datactrl | last post by:
Hi, all Is there any way to make a SELECT field in HTML as a read only field? Jack
2
7137
by: RC | last post by:
I would like to go to a specific record based on what the user types in a text box on a form. I have a table named: Boxes in the table there is a field named: BoxNumber a form named: BxForm and a text box on the form named: GetNumBox I want to type a number in the text box and then press the enter key on the keyboard and go to the corresponding record.
0
1404
by: kkrizl | last post by:
I'm having a very bizarre problem. I open up my table in datasheet view, and I click on edit, find. In the Find and Replace dialog box, I enter an address (123 main for example). If I set the Look In parameter to a specific field (Mailing Address), my record is found. If I go back up to the top of the table, and set the Look In parameter to my table name to search all of the fields in the table so that I can also search the Street...
1
1112
by: coacalli | last post by:
Greetings from the 3rd world This is the thing, i have a table, records on it with fields each and every one of them. i need to figure uot a way to update one, and only one field per record at the time (is what the boss asked for) any advice on it?
3
1683
by: jaymaelescent | last post by:
I have been asked by worklace to try and make a database for them, i have some experience but have encountered a problem making user specific reports. I need to make a report based on a person stored within the data base showing a series of data where i single field is null, So the things i need to know is: *How to make a query to pull out only data related to a specific field *How to make that field be that the report will...
3
3467
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were some method, similar to FIND RECORD (e.g., CTL + F ), where a dialog box would pop up and let me enter the field name, and then jump the cursor to that location. I currently do my edits by locating a record to be changed by ID using CTL+F and...
5
4079
by: theine | last post by:
How do I create Hyperlink based of a specific field in the same row? In Excel it done like this: =HYPERLINK("", A273) where the anything inside the " " is the value it's looking for in that particular cell. How do I do a similar thing in Access?
1
3124
by: sukatoa | last post by:
I still do the process of incrementing a specific field in a stand alone apps by query 1: get its value query 2: update value +1 But, i realize that this is really a bad idea when this would be used in web applications... specially the database is in another webhost....(very slow response) i tried (using php function)
3
3547
by: Ron Mowry | last post by:
I am wanting to create a macro that will fill a specific field on a form and then go to the next record set. I have a blank field in the table that the form is pulling from. I want the user to be able to click a button I have inserted into the form which will go to the next record but I also want that button to fill in that blank field on the form with the users initials before moving to the next record. I do not want the user to type anything...
0
8832
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
9566
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...
0
9388
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
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
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
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...
0
6078
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
3319
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
2791
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.