Solved

Creating forms in vba

Posted on 2014-09-10
4
144 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
[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
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

740 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