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

Editting multiple records at once using code

Hi all,

I'm bothered with this question for weeks now.... Is it possible to edit
multiple records at once using VBA? I have this continuous form and
depending on the selection the user makes, I want to edit another table
(not the recordsource of the form) in my database. How can I access the
selected records in VBA? Any ideas would be very welcome....

Thanks in advance,

Wim

Nov 12 '05 #1
3 5768
Yes: you can Execute an Update query statement, or OpenRecordset and edit
the record(s) in the other table(s).

The question arises as to why you would want to do that. Logging something
would be a good reason. Storing dependent data in another place would
probably not be a good reason.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Wim Verhavert" <wi***********@yahoo.com> wrote in message
news:10***************@seven.kulnet.kuleuven.ac.be ...

I'm bothered with this question for weeks now.... Is it possible to edit
multiple records at once using VBA? I have this continuous form and
depending on the selection the user makes, I want to edit another table
(not the recordsource of the form) in my database. How can I access the
selected records in VBA? Any ideas would be very welcome....

Nov 12 '05 #2
Allen Browne wrote:
Yes: you can Execute an Update query statement, or OpenRecordset and edit
the record(s) in the other table(s).

The question arises as to why you would want to do that. Logging something
would be a good reason. Storing dependent data in another place would
probably not be a good reason.


I don't quite follow you there. How do I make a distinction between a
selected record and a not-selected one. I can't specify the rules for
filtering the records. So for example if the form consists of let's say
350 records, the user can select for example 10 of them (I don't know
which one), pushes a button and then all the selected records are
altered, not the other ones. How can I figure out which where the ones
that he selected?

Nov 12 '05 #3
Presumably you have some field (primary key) that uniquely identifies a
record in the form? If only one record is selected, you can just refer to
that field, and it will have the value of the current record.

In a continuous form or datasheet, the user can select multiple contiguous
records. SelTop and SelHeight will let you identify the selection.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Wim Verhavert" <wi***********@yahoo.com> wrote in message
news:10***************@seven.kulnet.kuleuven.ac.be ...
Allen Browne wrote:
Yes: you can Execute an Update query statement, or OpenRecordset and edit the record(s) in the other table(s).

The question arises as to why you would want to do that. Logging something would be a good reason. Storing dependent data in another place would
probably not be a good reason.


I don't quite follow you there. How do I make a distinction between a
selected record and a not-selected one. I can't specify the rules for
filtering the records. So for example if the form consists of let's say
350 records, the user can select for example 10 of them (I don't know
which one), pushes a button and then all the selected records are
altered, not the other ones. How can I figure out which where the ones
that he selected?

Nov 12 '05 #4

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

Similar topics

2
by: dave | last post by:
i suspect i know the answer to this already, but here goes anyway.... i have a table that has field of varchar(2048), which once in a blue moon i need to edit the data manually (until a bad...
6
by: Christopher Harrison | last post by:
Is there a way to store an indefinite number of keys in one field and self join them? Imagine, for example, you have a table of users with a "friends" column. Say user 1 is friends with users 9, 7,...
19
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
4
by: ApexData | last post by:
I have a continuous form that has Allow- Add/Edit/Del set to False, so that the form is in View mode only. I have New/Edit/Del buttons in the form header. My New & Edit buttons work as a like. ...
7
by: Pim75 | last post by:
Hello, I want to store multiple records at once in a SQL database with a For..Next instruction like the sample code below: For counter = 0 To 100 Dim dbInsert As New SqlCommand( _ "INSERT...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.