Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A BIG question 1

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi

I need you to help me with this:

1) Allow user to select multiple rows from the listbox
2) Send selected rows (and each row represents a record) to the spreadsheet
3) Automatically change in all sent records field called status

Well, what I want to find out is if the tasks listed above are possible to perform in Access and if anyone has any ideas (and/or code), PLEASE let me know

Thanks
 
Definitely do-able in Access....in fact you'll be surprised that most anything can be done in Access.

First, to allow users to select multiple rows in a list box, change the list box's Multi Select property from "None" to either "Simple" or "Extended" (difference is that simply only allows a continuous range of selected values, and extended can be a non-continuous selection - the preferred setting for users).

Now you've got multiple selections.
The question is which ones are selected.
Simply loop through the items in the list box and check if the Selected property is True.


Example:
Assuming you're using column heading and that the record id is in the first column of the list box control.
(if you're not using column headings make the For look from 0 to Me.List1.ListCount)

Dim i As Long
Dim RecID As Long

'Assuming you're using column headings
For i = 1 to Me.List1.ListCount - 1
If Me.List1.Selected(i) Then
RecID = Me.List1.Column(0,i)
'do some work like updating the value of a status
'or export the record a Excel or another working table
'that can be sent to Excel
End If
Next i



Hope this helps or starts you on in the right direction.
 
Thanks a lot DougStevens!!!
Appreciate your help
I am marking your post as a helpful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top