473,757 Members | 10,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading Combo Boxes on Subform within Tab Control - Help!

I hope that someone can offer a little advice on this one - I've
searched the group but can't find an answer. I think that I'm doing
something really stupid or missing something trivial, but see what you
can make of this...

I have a main form "Events" that contains a tab control. The tab
control has 7 pages. The 7th page (named "Boats") contains a subform
called "BoatEventssubf orm". On this sub-form are two combo boxes,
named "SupplierCo mbo" (unbound) and "BoatNameCo mbo" (bound to
"BoatID", an Autonumber Primary key).

The purpose of this whole form is to set up different aspects of
organising sailing events for a sailing club. Specifically this part
of the form is associate boats to an event by selecting a supplier
(yacht charter company) from the "SupplierCo mbo" list and filtering
the list of craft in the "BoatNameCo mbo" list to show only the yachts
in that supplier's fleet. Both combo boxes display some additional
information in the pick list e.g. location of supplier, location of
yacht but only the supplier name and boat name when the entries are
selected.

SQL for the two combo boxes is as follows:
SupplierCombo:
SELECT Suppliers.Suppl ierID, Suppliers.Suppl ierName,
Suppliers.Colle ctionPostalCity
FROM Suppliers;

BoatNameCombo:
SELECT Boat.BoatID, Boat.BoatName, BoatType.BoatBr and,
BoatType.BoatMo del, Boat.Location, BoatType.Berths ,
BoatType.Layout Type
FROM BoatType INNER JOIN Boat ON BoatType.BoatTy peID = Boat.BoatTypeID
WHERE
(((Boat.Supplie rID)=[Forms]![BoatEventssubfo rm].[Form]![SupplierCombo]))
ORDER BY Boat.BoatName, Boat.Location;

I also use the following code in the "After Update" property of
"SupplierCo mbo" to update the list in "BoatNameCombo" :
Private Sub SupplierCombo_A fterUpdate()
Me.BoatNameComb o.Requery
End Sub

The filtering works exactly as planned when I open the sub-form on
it's own, but when it is opened as designed within the main form, the
"Enter Parameter Value" box is displayed with the parameter
"Forms!BoatEven tssubform.Form! SupplierCombo". For debug purposes,
I've put a text box onto the sub-form to display the value of
"SupplierID ". I have noticed that when the parameter value input box
is shown, the text box hasn't yet been updated with the new value.

This behaviour leads me to think that I am not correctly referencing
the first combo box from the second, and that specifically I'm missing
something to do with the tab control on the main form.

I'd be grateful for any suggestions as this is now driving me mad!

Thanks in Advance, Mike
Jan 28 '06 #1
3 5344
Mike Jakes wrote:
[snip]
I have a main form "Events" that contains a tab control. The tab
control has 7 pages. The 7th page (named "Boats") contains a subform
called "BoatEventssubf orm". On this sub-form are two combo boxes,
named "SupplierCo mbo" (unbound) and "BoatNameCo mbo" (bound to
"BoatID", an Autonumber Primary key). SQL for the two combo boxes is as follows:
SupplierCombo:
SELECT Suppliers.Suppl ierID, Suppliers.Suppl ierName,
Suppliers.Colle ctionPostalCity
FROM Suppliers;

BoatNameCombo:
SELECT Boat.BoatID, Boat.BoatName, BoatType.BoatBr and,
BoatType.BoatMo del, Boat.Location, BoatType.Berths ,
BoatType.Layout Type
FROM BoatType INNER JOIN Boat ON BoatType.BoatTy peID = Boat.BoatTypeID
WHERE
(((Boat.Supplie rID)=[Forms]![BoatEventssubfo rm].[Form]![SupplierCombo]))
ORDER BY Boat.BoatName, Boat.Location; [snip] The filtering works exactly as planned when I open the sub-form on
it's own, but when it is opened as designed within the main form, the
"Enter Parameter Value" box is displayed with the parameter
"Forms!BoatEven tssubform.Form! SupplierCombo". For debug purposes,
I've put a text box onto the sub-form to display the value of
"SupplierID ". I have noticed that when the parameter value input box
is shown, the text box hasn't yet been updated with the new value.

This behaviour leads me to think that I am not correctly referencing
the first combo box from the second, and that specifically I'm missing
something to do with the tab control on the main form.

[snip]

It's not the TabControl. That doesn't affect how you reference form objects at
all. When referencing a control on a subform you have to "go through" the main
form. Your reference doesn't mention the main form. You need...

WHERE
(((Boat.Supplie rID)=[Forms]![Events]![BoatEventssubfo rm].[Form]![SupplierCombo]))
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Jan 28 '06 #2
On Sat, 28 Jan 2006 22:34:55 GMT, "Rick Brandt"
<ri*********@ho tmail.com> wrote:

[snip]
The filtering works exactly as planned when I open the sub-form on
it's own, but when it is opened as designed within the main form, the
"Enter Parameter Value" box is displayed with the parameter
"Forms!BoatEven tssubform.Form! SupplierCombo"

[snip]

It's not the TabControl. That doesn't affect how you reference form objects at
all. When referencing a control on a subform you have to "go through" the main
form. Your reference doesn't mention the main form. You need...

WHERE
(((Boat.Suppli erID)=[Forms]![Events]![BoatEventssubfo rm].[Form]![SupplierCombo]))
[snip]


Thanks for the quick response Rick - much appreciated

I tried your suggestion, but when running the main form "Events" I
again get the parameter prompt, this time for
"Forms!Events!B oatEventssubfor m.Form!Supplier Combo".

I also now get the same prompt when running the sub-form
"BoatEventssubf orm" on it's own (which I think I understand -
basically the sub-form running in isolation doesn't require the
[Events] reference as in this mode it's not running as an embedded
control - of course, I could easily be misunderstandin g the concept!).

Any other ideas, suggestions or divine inspiration would be more than
welcome!

Thanks again, Mike
Jan 29 '06 #3
Mike Jakes wrote:
Thanks for the quick response Rick - much appreciated

I tried your suggestion, but when running the main form "Events" I
again get the parameter prompt, this time for
"Forms!Events!B oatEventssubfor m.Form!Supplier Combo".

I also now get the same prompt when running the sub-form
"BoatEventssubf orm" on it's own (which I think I understand -
basically the sub-form running in isolation doesn't require the
[Events] reference as in this mode it's not running as an embedded
control - of course, I could easily be misunderstandin g the concept!).

Any other ideas, suggestions or divine inspiration would be more than
welcome!


First off there is no reference that will work in both circumstances. If
you need to use this form both as a subform and as a stand-alone form then
you need a different strategy. As for the reference when it is a subform
the correct generic syntax is definitely...

Forms!NameOfPar entForm!NameOfS ubformCONTROL.F orm!NameOf Control

Notice the ALL-CAPS portion. The syntax requires the name of the subform
*control* which is not necessarily the same as the form contained within
(often it is though). When in doubt I use the expression builder to navigate
to the control.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



Jan 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3328
by: Cameron | last post by:
Hi, For the database I am currently working on, my employer would like the ability to use multiple combo boxes in order to filter the database. For instance the structure of the company is based on regions, which are managed by a number of coordinators, who oversee a large group of associates. I would like to use a combo box so that people accessing the database can choose a particular region and then have a second combo box that only...
0
2078
by: cognoscento | last post by:
I'm currently putting together a database for my work (not an expert by any stretch, so muddling through as best as I can... you know the story...) and I could use some advice and hand-holding I've got a subform with a series of cascading combo boxes (thanks to the Access tutorials on fontstuff.com) that let the user assign categories to items, in this case photos. This is being done to help constrain user selections and keep the...
4
64630
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
6
3682
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
2
2286
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and cboException) to filter difference absences (ie.Regular, Overtime, etc). cboCategory is filtered as follows: !!... Because I have the subform set up as a continuous form, I needed to add a text box (txtException) on top of one of the combo boxes...
5
4902
by: samdev | last post by:
I have created two combo boxes in a subform.... For example 1. Combo Box State 2. Combo Box City 3. When a state from the Combo Box State is selected, the City combo box updates to reflect the State chosen by only showing cities in that selected state. 4. When I open just the subform it works just fine but when I open the
3
2124
by: luciegiles | last post by:
I'd like to start off with an apology - I posted a question on a similar matter sometime ago and didn't respond to those who took the time to answer my question. At the time i gave up but have used the responses I got to revisit this now - thanks to those who reposnded originally. I'm nearly there but need help with some syntax (I think). I am filtering the option in one combo box cboStatus based on the entry to another combo box...
20
4143
by: luciegiles | last post by:
Hi, I have used the tutorial Cascading Combo/List Boxes to filter the combo box cboCareManager dependent on the entry to cboLocalityTeam - the common code between the two tables is LocalityCode. cboCareManager and cboLocalityTeam both sit within frmSub which in turn is a subform within frmMain. The AfterUpdate code is as follows: Private Sub cboLocalityTeam_AfterUpdate() With Me! If IsNull(Me!cboLocalityTeam) Then .RowSource...
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.