Solved

building forms in Microsoft access with vba

Posted on 2014-03-05
6
4,955 Views
Last Modified: 2014-03-06
hi


Does anyone have code that allows building forms in Microsoft access, like the form wizard, something that i can control and add to there my personal preference that I do routinely on every form. this can save me a lot of time of work
0
Comment
Question by:bill201
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 22

Assisted Solution

by:Kelvin Sparks
Kelvin Sparks earned 166 total points
ID: 39908475
Here's a link to get you started
http://forums.databasejournal.com/showthread.php?33839-Programmatically-create-a-form-using-VBA

I suspect if you can get the Access Developers books by Ken Getz et al, there'll be full code examples there.

Kelvin
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 39908478
0
 
LVL 10

Assisted Solution

by:Anthony Berenguel
Anthony Berenguel earned 167 total points
ID: 39908479
Hi Bill,

Take a look the first reply in the link below that explains how to add a textbox control to a form. I think once you figure that out it will be easy for you to add the other controls and you can go from there.

example

Good luck,
ab
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bill201
ID: 39908642
aebea


thanks for your answer but the link don't work
0
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 167 total points
ID: 39908648
Hi,

you can of course build a form programmatically but there are easier methods to achieve what you want (>= A2007):

1. Form Templates


Create a form which you want to use as template and set all the desired properties. Then open the Access options and go to "Object Designers". Scroll down to the section "Forms/Reports", there you'll find two input boxes where you can enter the name of the form which should be used for any new form (and the other one the same for reports)

2. Control Templates


This one can be used in all forms but is valid only for the current form, not all forms. Open the form in design mode and click on the control you normally would insert now into your form. Instead of inserting it, go to the properties window and you'll see that the title has changed to "Default Text Box" (if you clicked the TextBox icon before). Now you can setup all the desired properties for the TextBox and whenever you insert one into this form it will have the default settings.

3. Assign template layout


(This one also works in versions before A2007). When you have created your template form, open it in Layout View and then open the rightmost dropdown "AutoFormat" in the "Format" ribbon. Select "Autoformat Wizard" at the bottom to open the good old AutoFormat selector known from earlier versions (there in the Form Assistant). Click on the "Customize" button and there you can choose "Create a new AutoFormat based on the form "YourTemplateForm"". This will be added to the AutoFormat list and in your next form you can simply choose that to apply all your formattings.

4. Template Forms Copy


The even simplest method: Create a template form with controls and code and anything you want including the above described Control Templates and save it as a template form. Whenever you need that, copy and paste it to a new form, that's it. With this you can have as many forms as you want. You could even create a template database to store such forms and drag and drop that from one database to another.

5. Use tools


You can also use tools to manage your templates, one of this (freeware) can be found here:
http://www.skrol29.com/us/vtools.php

More information about templates can also be found at Allen Browne's page here:
http://allenbrowne.com/ser-43.html

Cheers,

Christian
0
 

Author Closing Comment

by:bill201
ID: 39908726
thanks a lot
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question