Solved

building forms in Microsoft access with vba

Posted on 2014-03-05
6
5,095 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

615 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