Charlie,
Hmm. Maybe I'm not understanding. I don't know why a delete would be different from an insert...but in any case, if this is the only place you'll be using the macro, VBAJock's method should work. On the other hand, I would guess that you would be able include screen.activeform.name in the sql statement to grab the name of that form without having to code anything.
If I were to do this it would be in code instead of a macro (I never use 'em), and I would simply call the function and pass a parameter of the form's name. I guess I'd add other details as parameters, too, to make it as generic as possible [this is completely untested aircode. Test it carefully]:
Function AddAuditRecord(strFormName as String, strActionType as String)
dim db as dao.database
dim strSql as string
set db = currentdb
strsql = "Insert Into [Audit_Log] (Ref, Dateofentry, Action, FormName) VALUES (fOSUserName() AS Ref, Now() AS Dateofentry, '" & strActionType & "', '" & strFormName & "')"
DB.execute(strsql, dbfailonerror)
db.close
set db = nothing
end function
Hope that helps some.
Jeremy ==
Jeremy Wallace
AlphaBet City Dataworks
See the Developers' section
Please post in the appropriate forum and include 1) a descriptive subject 2) code and SQL, if referenced,
and 3) expected results. See thread181-473997