guamlet
Board Regular
- Joined
- Dec 29, 2002
- Messages
- 145
I want to do an edit to a table based on a form's combo box value and cross reference to a listbox value. For example, if the user selects terminate from the combobox, and has three items highlighted on the listbox, I want the macro to go to the table where the items are tblItems, go to the row where that item from the listbox is, and go to the chkDiscontinued checkbox and make it true. I have the following code for starters, but can't seem to make the checkbox get checked!
For i = 0 To lstLineID.ListCount - 1
If cmbActionType = 5 Or cmbActionType = 6 Or cmbActionType = 3 Then
strSQL = "Select * from [tblLines]"
Set rs = db.OpenRecordset(strSQL)
rs.Edit
rs!LineID = lstLineID.Column(0, i)
rs!Discontinued = True
rs.Update
End if
Next i
Any suggestions? Thanks
For i = 0 To lstLineID.ListCount - 1
If cmbActionType = 5 Or cmbActionType = 6 Or cmbActionType = 3 Then
strSQL = "Select * from [tblLines]"
Set rs = db.OpenRecordset(strSQL)
rs.Edit
rs!LineID = lstLineID.Column(0, i)
rs!Discontinued = True
rs.Update
End if
Next i
Any suggestions? Thanks