I get a 'No Current Record' MS Access error message on the first line of code below:
If rst("PROFESSIONAL_REG_NUMBER") > 0 Then Set db1 = CurrentDb()
strSQL1 = "SELECT * FROM Table2 WHERE Professional_REG_Number = " & rst("PROFESSIONAL_REG_NUMBER")
'Set db1 = CurrentDb()
Set rst1 = db.OpenRecordset(strSQL1, dbOpenDynaset)
With rst1
If Not (.BOF Or .EOF) Then
.Edit
.Delete
.Edit
.Update
End If
.Close
End With
Set rst1 = Nothing
Set db1 = Nothing
Else
'Do Nothing
End If
The expected result is for the 'Else' statement to be executed if any records do not exist.
Can anyone tell me why this is happening?
Any help is appreciated.
Thanks.
If rst("PROFESSIONAL_REG_NUMBER") > 0 Then Set db1 = CurrentDb()
strSQL1 = "SELECT * FROM Table2 WHERE Professional_REG_Number = " & rst("PROFESSIONAL_REG_NUMBER")
'Set db1 = CurrentDb()
Set rst1 = db.OpenRecordset(strSQL1, dbOpenDynaset)
With rst1
If Not (.BOF Or .EOF) Then
.Edit
.Delete
.Edit
.Update
End If
.Close
End With
Set rst1 = Nothing
Set db1 = Nothing
Else
'Do Nothing
End If
The expected result is for the 'Else' statement to be executed if any records do not exist.
Can anyone tell me why this is happening?
Any help is appreciated.
Thanks.