By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 985 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Editting multiple records at once using code

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.