icemonster
Registered User.
- Local time
- Today, 10:38
- Joined
- Jan 30, 2010
- Messages
- 502
ok, so i have this code
what it does it, when i click the command confirm, it will confirm the status of all the records selected in the listbox,
anyone know how instead of using a command, i use a combo box for the choices of what status i want it to be?
e.g
10 records status is cancelled, so i choose in the combo box the status cancelled and when done, click a button that will change all of the status in the listbox that was selected. thanks!
Code:
Private Sub cmdConfirm_Click()
For Each varItem In Me.lstSchedule.ItemsSelected
'read the selected Item Id
lngSchdulRecID = Me.lstSchedule.ItemData(varItem)
'update the fields in the record in the "tblSchedule" table
strSQL = "SELECT tblSchedule.Status, tblSchedule.StatusDate FROM tblSchedule " _
& "WHERE (((tblSchedule.ScheduleRecID)=" & lngSchdulRecID & "));"
Set rs = CurrentDb.OpenRecordset(strSQL)
rs.Edit
rs.Fields("Status").Value = 1
rs.Fields("StatusDate").Value = Date
rs.Update
rs.Close
Set rs = Nothing
Next varItem
'clear all selections
For Each varItem In Me.lstSchedule.ItemsSelected
Me.lstSchedule.Selected(varItem) = False
Next varItem
Me.lstSchedule.Requery
End Sub
what it does it, when i click the command confirm, it will confirm the status of all the records selected in the listbox,
anyone know how instead of using a command, i use a combo box for the choices of what status i want it to be?
e.g
10 records status is cancelled, so i choose in the combo box the status cancelled and when done, click a button that will change all of the status in the listbox that was selected. thanks!