?
Solved

Creating forms in vba

Posted on 2014-09-10
4
Medium Priority
?
149 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 58
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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

765 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