I have searched for a long time to solve this issue all I can get is the is the code which give me the error. I should be able to find the answer by microsoft but there sites are less than helpful
Here is my complete code what is wrong or what am I missing ( what referrance or what import is required) all I want to do is change an accdb table name with vb.net and a textbox or inputbox.
Private Sub btnCHGName_Click(sender As System.Object, e As System.EventArgs) Handles btnCHGName.Click
On Error GoTo Err_ErrorHandler
Dim Con As OleDbConnection
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("NameNewTable", acTable, "strTable") ' (also tried to use acDefault in place of acTable with same error)
MsgBox("Table successfully renamed.", vbInformation)
End If
Exit_ErrorHandler:
strTable = vbNullString
Exit Sub
Err_ErrorHandler:
MsgBox(Err.Description, vbExclamation, "Error #" & Err.Number)
Resume Exit_ErrorHandler
End Sub
I don't care what the code is I just want to change the friken name Why the hell does microsoft make every thing so complicated. This should be an easy procdure.