OK, I need to delete some records when a form is closed.
When the form is closed, I have a module run, which will inlude the code to delete the records.
The records to be deleted depend on what the user entered into a certain field on the form (say the form field is called "Number"
. So if they entered in 1111 on the form, then records matching 1111 would get deleted.
This is what I have, but it does not currently work.
************
Public Function Function_Name()
strSQL = "DELETE TableName.* FROM TableName WHERE TableName.FieldName=" & Me!Number.Value & " WITH OWNERACCESS OPTION;"
DoCmd.RunSQL strSQL
End Function
**********************
It errors out stating that an Object is needed for strSQL.
Any help would be apprecaited..
MitchJP
When the form is closed, I have a module run, which will inlude the code to delete the records.
The records to be deleted depend on what the user entered into a certain field on the form (say the form field is called "Number"
This is what I have, but it does not currently work.
************
Public Function Function_Name()
strSQL = "DELETE TableName.* FROM TableName WHERE TableName.FieldName=" & Me!Number.Value & " WITH OWNERACCESS OPTION;"
DoCmd.RunSQL strSQL
End Function
**********************
It errors out stating that an Object is needed for strSQL.
Any help would be apprecaited..
MitchJP