When I delete a record and hit the 'Me.Requery' statement, it goes straight to the error routine and displays 'Recodr is deleted' (no err.number displays).
how do I show the table with the deleted records no longer showing?
Private Sub cmdDeleteRecords_Click()
'CAN'T GET THE REQUERY FORM TO WORK
Dim cnt As Integer
Dim delBid As String
On Error GoTo deleteRecordsError
Set db = CurrentDb()
Set JBrec = db.OpenRecordset("JB_Jobs", dbOpenDynaset)
'delete this job
delstrSql = "JB_Deletesw = true and JB_JoborBid = false"
JBrec.FindFirst delstrSql
Do While Not JBrec.NoMatch
delBid = JBrec(0)
MsgBox " Ready to delete bid " & strQuote & delBid & strQuote
JBrec.Delete
JBrec.FindFirst delstrSql
Loop
MsgBox "There are no Bid records to delete"
txtDeletesw.SetFocus
cmdDeleteRecords.Visible = False
Me.Requery
'get error here after requerry "record already d4eleted"
'Call Form_Close
Exit Sub
deleteRecordsError:
MsgBox "deleteRecordsError: " & Err.Description & " - " & Err.Number
End Sub
how do I show the table with the deleted records no longer showing?
Private Sub cmdDeleteRecords_Click()
'CAN'T GET THE REQUERY FORM TO WORK
Dim cnt As Integer
Dim delBid As String
On Error GoTo deleteRecordsError
Set db = CurrentDb()
Set JBrec = db.OpenRecordset("JB_Jobs", dbOpenDynaset)
'delete this job
delstrSql = "JB_Deletesw = true and JB_JoborBid = false"
JBrec.FindFirst delstrSql
Do While Not JBrec.NoMatch
delBid = JBrec(0)
MsgBox " Ready to delete bid " & strQuote & delBid & strQuote
JBrec.Delete
JBrec.FindFirst delstrSql
Loop
MsgBox "There are no Bid records to delete"
txtDeletesw.SetFocus
cmdDeleteRecords.Visible = False
Me.Requery
'get error here after requerry "record already d4eleted"
'Call Form_Close
Exit Sub
deleteRecordsError:
MsgBox "deleteRecordsError: " & Err.Description & " - " & Err.Number
End Sub