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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: Multi-select in access97

Status
Not open for further replies.

ags91

Vendor
Jul 16, 2001
10
AU
hi,

I have a simple student database that i would like to update with their attendance. I would like to make it easy by selecting certain students from a "list" and after entering the date it updates their record.

Any help would be greatly appreciated

Andrew
 
To run through the list of selected students, use the ItemsSelected collection of the listbox. Then within the loop (e.g.
Code:
for each i in me!lstMyListbox.ItemsSelected
) you can use the ItemData(i) property to access the Student Primary Key field of each selected student (i.e. have the listbox bound to the StudentID field, etc.).

Now that you have access to all the student ID's, and you of course have access to the date field (Me!txtMyDate), you can open a table-type recordset (
Code:
set rst = currentdb.openrecordset("Students Table")
) and edit the records appropriately using the .Edit and .Update methods of the recordset.
 

Can do this through code - i'll leave that to the professionals:)

If you want a quick solution, add an extra field to your students table which is a check box. Then create a form based on your students table.

On your form have a Command Button that runs an update query based on which check boxes have been flagged then run another update query to set check boxes to false.

Stew
 
thanks for the help.. this points me in the right direction.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top