Solved

Creating forms in vba

Posted on 2014-09-10
4
143 Views
Last Modified: 2014-09-10
I have a number of queries that are created dynamically based on client/model. i can  create lists of those no problem. What I am unsure of is how to create the subforms and get them onto a master form.

so for example:

Access has done its work and created two queries:
QryAbi3Series
QryCap3Series

so I want to align the two (in this case) subforms next to each other on the master form.

That bit I am struggling to implement is if i had two sets of models (or more):
QryAbi3Series
QryCap3Series      for info these show all bmw 3 series models for these two clients

QryAbiCClass
QryCapCClass          for info these show all mercedes CClass models for these two clients


I would need a combo on the master form that would then allow me to choose which model set.


not sure how to inplement that.

I am in vba
0
Comment
Question by:PeterBaileyUk
  • 2
  • 2
4 Comments
 
LVL 57
ID: 40314122
The usual approach is to do a subform for each and keep them hiidden.

Then, based on the combo selection, make the appropriate one(s) visible.

Jim.
0
 

Author Comment

by:PeterBaileyUk
ID: 40314140
will it matter that the recordsource in this case the queries being dynamically created will effectively change their name whilst processing?
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 40314160
I'm not quite sure I follow.   Let me make a few comments and see if it makes it clearer:

When working with subforms:

1. You can change the recordsource.  This is typically done when you have identical tables, and want to switch between them keeping the same controls.

2. You use multiple subforms and hide/unhide as needed.   You do this when the controls/layout needs to change.  

3. You can within a single subform, change the recordsource and hide / unhide controls to handle cases where the controls/layout need to change (like #2), but in general it's far easier to simply use multiple subforms.

 Not sure if that helps or not...

Jim.
0
 

Author Comment

by:PeterBaileyUk
ID: 40314167
ok i will experiment around that advice
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

839 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