I try to run the following procedure from my forms vba module from a macro
Function ZapLastRecord(strTable As String)
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset(strTable)
With rst
If rst.RecordCount > 0 Then
.MoveLast
Do
.Delete
.MoveNext
Loop Until .EOF
Else
MsgBox "There are no work orders"
End If
.Close
End With
End Function
And I get this error:
'You tried to run a visual basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for Automation operations.
Check the components documentation for information on the properties and methods it makes available for automation operations.
Any ideas?