I have created a macro that calls to a module. I can get it to run but from a user standpoint, it would be confusing to perform. Here is the code to the module:
Private Function MyButton_Click()
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 have designed an Open Module macro but I would like to have it not show the module and have the user run the sub form to rename the table. I want the dialog box to have the user enter in the new table name and have the "Table successfully renamed" box appear, then click OK and return to my switchboard.
Is it possible to code for that? I am somewhat of a novice and found the coding above in some other forums but haven't been able to find anything regarding this issue.
Thanks in advance!