473,387 Members | 1,455 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,387 software developers and data experts.

Update specific record position in table using recordset

Hello,

Good morning,

I have a question, hope someone can help me.

I have a table with say, 5 columns, each named A,B,C,D,E

The table was imported from Excel, so picture please this:

The first 20 rows (or records) of the imported table are blank, what i need to do is to find the first record position (21) in column B (which in Access would be called a field) which is not blank and in the previous row (or previous record) add a string called "IMO".

What i thought is to use a recordset, use a loop cycle until the length of the record is not 0, then use the AbsolutePosition - 1 in a variable and use that to mark the row number (or record number) where i should update.

But the hard part is, how do i update the table?, maybe with an update query using docmd.runsql, but the problem is that i don't know how to update specifically "cell B20", or in Access terms, field B, record number 20.

Thank you and best regards

Please help
Mar 7 '08 #1
1 3475
Delerna
1,134 Expert 1GB
Hi afromanam
I have to ask, is this a one off task. Updating the B field in the first 20 rows to "IMO" I mean. If so it would be far simpler to just open the table and update them manually.

If it's not a one off task, then is it always the first 20 rows and is it always 20. If so then you could use vba to open a recordset object on the table and loop through the recordest for the first 20 rows doing an update on the B field as you go. Then you could do an update on the recordset at the end so that the changes get committed back to the table.
Mar 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
2
by: rp | last post by:
Not sure if this is an Access Issue or ASP but here goes I have an asp script which does an which opens up a recordset against an access table I then do a .AddNew. <insert the date into the...
4
by: Roy Adams | last post by:
Hi posting again because no answer to previous.. tring to loop through a recordset and update a record, thing is it only updates the first record in the table rather than searching through the...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
15
by: graham | last post by:
Hi all, <bitching and moaning section> I am asking for any help I can get here... I am at the end of my tether... I don;t consider myself a genius in any way whatsoever, but I do believe I have...
2
by: DaveN | last post by:
Hi all, I'm trying to update a record in a table with data from text boxes on a form. As a background to this, I managed to add a new record to the table in a similar manner with the following:...
5
by: JohnR | last post by:
I have multiple controls set to the same database and, normally, when I change the record in one control the position is also changed in the other controls because I have "syncwithcurrencymanager'...
1
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.