Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Creating a basic Form from a Table with VB

Creating a basic Form from a Table with VB

Creating a basic Form from a Table with VB

I tried this question under the Forms and Access Modules (Coding)....Forums. I did not get any responses. If anyone can help please or direct me where I can get help.

1. In MS Access 2013 I can single click a Table in the table list - In design view. With a table highlighted I can select the Create Ribbon and select Forms and then select Form. This will create a very basic Form based on the selected Table and display it.

2. What I am currently doing with VB is loading and naming Tables from a selected spreadsheet. The code goes to each Sheet in the work book. For each Sheet it will create and load a Table in Access....using the Sheet name as the new Table name. It then repeats for each remaining Sheet in the work book.

3. What I would like to include, after each Table is built and populated, is to create the "basic" form described in Paragraph 1 above. I have described what can be done manually but need to be able to do it from code. I have searched the net using various criteria looking for an answer. I have not found anything even close.

I have tried the DoMenu functionality but the "Create - Forms - Form" button is not on the list of menu items VB can work with.
I have also used the file menu and the SaveAs selection with the table open. I can save it as a form but again I cannot find a way to do this in VB. It seems VB cannot do SaveAs.

Any suggestions would be very helpful to myself and my users here at work.

Then, of course, using the VB to create a basic report would also be useful...but that comes after the Form

RE: Creating a basic Form from a Table with VB

You can try use something like:

CODE --> vba

Docmd.RunCommand acCmdNewObjectAutoForm 

You will need to first select an object or use VBA to select the object and then use DoCmd.

Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016

RE: Creating a basic Form from a Table with VB

Duane. Great, thank you very much. I will give this a try in the next day or so. I will let you know how it turns out.

RE: Creating a basic Form from a Table with VB

Sorry it has been so long. Your suggest worked just great.

Thank you

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close