I am attempting to do a run code macro in a form and I keep getting this error message when ever I attmept to launch it.
I click OK on the error message and a box comes up to halt the macro with this information:
Macro Name:
Archive Current Audit
Condition:
True
Action Name:
Run Code
Arguemnts:
RenameTable_Click(ArchiveCurrentAudit)
I halt the macro and this message comes up:
The object doesn't contain the Automation object 'ArchiveCurrentAudit'
Below is the coding that is being run...I can run it from the module I have set up for it but I would like to have users click on a command button, enter in a new name of a table to archive it so that a new one can be created. Once the user has renamed the table, I'd like to have them come back to the form. Any ideas?
Public Function RenameTable_Click(ArchiveCurrentAudit)
On Error GoTo Err_ErrorHandler
Dim strTable As String
strTable = InputBox("Please enter the new table name.", "Table Name")
If strTable = vbNullString Then
MsgBox "No table name entered.", vbExclamation
Else
DoCmd.Rename strTable, acTable, "Server List"
MsgBox "Table successfully renamed.", vbInformation
End If
Exit_ErrorHandler:
strTable = vbNullString
Exit Function
Err_ErrorHandler:
MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
Resume Exit_ErrorHandler
End Function
I am a novice at coding...just starting to learn on my own. I am going to take some classes to get better at this but right now, I have a project I need to compelte that is related to the use of this database.
Thanks!