Selected Rows Collection

J

JimS

I have a form based on a sql statement, then filtered.

My user can use standard windows keystrokes to select a subset of the
records. How can I rifle through that collection using vba?

Obviously, I must be able to do it, but I've never wanted to before. Can you
point me there?
 
J

Jeff Boyce

Jim

More specific description will probably lead to more specific suggestions.

"rifle through" is a bit vague...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

JimS

Sorry, I just want to loop through the collection of "selected" rows and
update each selected row with the batch number the user has provided.
 
J

Jeff Boyce

Jim

Are you saying you want the user to select a collection of rows, then update
them all with the same "batch number"?

If so, one way to do this would be to have the users somehow mark each row
to be updated, then use a query to update ALL of them as a set, all at once,
rather than looping through one by one.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

JimS

My thought was the user would hold down the control key and click on the
half-dozen rows they want to select. Then, I would "batch up" the selected
rows. How do I know what rows the user has selected?
 
J

Jeff Boyce

Jim

I don't have a very clear sense of "where" this is happening...

If you are working directly in the tables, there's no way I know of to do
it.

If you are working in a datasheet, you might be able to cycle through the
collection of ItemSelected (I suspect this would work for a listbox in
multi-select mode also).

If you want a quick/dirty solution, add a Yes/No field to your underlying
table and display it on the form your users see, so they can "check" the
ones to "batch". This is the direction my previous post was headed.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Top