Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to create Form from Table.

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I put this post under Forms but decided to put it here also since I am looking for code.

puforee (TechnicalUser)
(OP)
25 Apr 17 23:23
In MS Access 2013 a form can automatically be created by clicking on a table name and then using the Create ribbon and Form button to automatically create a form. This is a very basic form but servers its purpose well for my project. Formatting is not an issue.

Now the question. I use code to import spreadsheet data to MS Access. This import will create a new table. The created table takes the name of the Excel Tab name. So, the code knows the table name. I want to add code to automatically create a form based on that table. Just like if I did it manually by selecting the table name and using the create ribbon Form button as described above.

Does anyone have any idea on how to do this with VBA?
 
You can manually test and edit with the Form object, but it might be easiest to start by recording a macro while creating a new form, then edit to fit your needs.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top