Solved

Creating forms in vba

Posted on 2014-09-10
4
134 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

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
ok i will experiment around that advice
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now