Share via

Create new table in backend

Anonymous
2010-12-22T11:19:02+00:00

My application uses ACCDE front end and ACCDB back end. It has been distributed to various locations (resides on single computer in each location). I´ve received a feature request that I´d like to accomodate but it requires the creation of several new tables.

  • How do I formulate the CREATE TABLE syntax to make sure the new tables are created in the back end?
  • Can I link the new tables in the front end via code? I´m a neophyte so if via code is too difficult or involved I can just do it the old fashioned way via the menu.

Thanks!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2010-12-22T11:32:04+00:00

To create a table:

Dim dbs As DAO.Database

Dim strSQL As String

Set dbs = OpenDatabase("C:\Databases\FiNDeM_BE.accdb")

strSQL = "CREATE TABLE tblNew (ClientID INTEGER PRIMARY KEY, LastName CHAR (30), DateOfBirth DATETIME)"

dbs.Execute strSQL, dbFailOnError

dbs.Close

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2010-12-22T11:36:24+00:00

And to link:

DoCmd.TransferDatabase TransferType:=acLink, DatabaseType:="Microsoft Access", _

  DatabaseName:="C:\Databases\FiNDeM_BE.accdb", _

  Source:="tblNew", Destination:="tblNew"

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2010-12-22T11:43:48+00:00

    Awesome!!!!

    Was this answer helpful?

    0 comments No comments