Access newbie: How to change the tableformreport ...

zhaozj2021-02-16  59

Novice to see: How to change the table / form / report ...

problem:

How to change the name or other database object

method one:

Change the table name, call adox (the test environment is adoX2.7)

Function Test () Debug.Print renameTableName ( "b", "cxcd") End FunctionFunction renameTableName (strOldName As String, strNewName As String) As Boolean On Error Resume Next Dim tbl As ADOX.Table Dim cat As New ADOX.Catalog Set cat .ActiveConnection = CurrentProject.Connection 'in the above sentence CurrentProject.Connection in VB to change the connection object is already open for Each tbl in cat.Tables If tbl.Name = strOldName Then tbl.Name = strNewName Next If Err.number < > 0 THEN RENAMETABLENAME = false else renametablename = true end ifend function

Method Two:

please use

DOCMD.Rename "New Table", ACTABLE, "Original Table Name" to do more reference help below Access 2000 help

转载请注明原文地址:https://www.9cbs.com/read-24517.html

New Post(0)