From Debug.Print:
Code:
CREATE TABLE 'tblLog' (LogEvent Text)
I don't see the problem?
The code:
Code:
Public Function InitLog(tblName As String) As Integer
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' Create the new table and bind it to the DAO Recordset rsLog. The logging action
' will record the actions into the DAO Recordset.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
On Error Resume Next
DoCmd.DeleteObject acTable, tblName 'Get rid of any old log table
On Error GoTo ErrorHandler
Debug.Print "CREATE TABLE '" & tblName & "' (LogEvent Text)"
CurrentDb.Execute "CREATE TABLE '" & tblName & "' (LogEvent Text)" 'Create a new log table
Set rsLog = DBEngine(0)(0).OpenRecordset(tblName) 'Bind new log to DAO REcordset
InitLog = 0
NormalExit: Exit Function
ErrorHandler: InitLog = Err.Number
MsgBox "Initialization error " & Err.Number & " " & Err.Description
GoTo NormalExit
End Function