G
Guest
All,
In the following SQL script I am trying to blank out the fields, but so far
it isn't working. Can you point me in the right direction.
Thanks!
'Setup the table and recordset to be edited
' strTablename = "Billing"
Set db = CurrentDb
Set rst = db.OpenRecordset(strTableName, dbOpenDynaset)
For Each i In Me![lstItems].ItemsSelected 'Determine the number of items
selected in the list
Criteria = Me![lstItems].ItemData(i) 'Assign the Customer Number a
variable
With rst
.MoveFirst
.FindFirst "[ID] = " & Criteria & "" 'Locate a Customer Number that
matches the one selected from the list
.Edit
.Fields("Assigned") = 0 'Uncheck the checkbox
.Fields("AssignedTo") = "" 'Clear the person's name from the record
.Fields("DateAssigned").Value = "" 'Clear the Assign date
.Update
End With
rst.Close
Next i 'Loop through the next record
Set db = Nothing 'Unset the Database
Set rst = Nothing 'Unset the recordset
Me.lstItems.Requery
Exit Sub
In the following SQL script I am trying to blank out the fields, but so far
it isn't working. Can you point me in the right direction.
Thanks!
'Setup the table and recordset to be edited
' strTablename = "Billing"
Set db = CurrentDb
Set rst = db.OpenRecordset(strTableName, dbOpenDynaset)
For Each i In Me![lstItems].ItemsSelected 'Determine the number of items
selected in the list
Criteria = Me![lstItems].ItemData(i) 'Assign the Customer Number a
variable
With rst
.MoveFirst
.FindFirst "[ID] = " & Criteria & "" 'Locate a Customer Number that
matches the one selected from the list
.Edit
.Fields("Assigned") = 0 'Uncheck the checkbox
.Fields("AssignedTo") = "" 'Clear the person's name from the record
.Fields("DateAssigned").Value = "" 'Clear the Assign date
.Update
End With
rst.Close
Next i 'Loop through the next record
Set db = Nothing 'Unset the Database
Set rst = Nothing 'Unset the recordset
Me.lstItems.Requery
Exit Sub