473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Getting a 3rd dependent combo box to work

5
Hi there,

I'm having trouble getting my 3rd dependent combo box to work in Access 2003.

I have three dependent boxes named cbogroup, cbosection and cbofunction. Each one is dependent on the selection made in the previous box. All of these appear on one form called 'records subform'.

The information for each box is taken from a different table. The first from 'functional group' which has only 2 fields: 'group' and 'group code'. The second box is populated from table 'functional section' which also contains the field 'group code' and this information is used to filter the choices for the second box. This is the row source for cbosection:

SELECT [Functional Section].[Section Code], [Functional Section].Section, [Functional Section].[Group Code] FROM [Functional Section] WHERE ((([Functional Section].[Group Code])=[cbogroup])) ORDER BY [Functional Section].[Section Code];

This works fine. However, my 3rd box won't play ball. The information is taken from table 'functional list' which is linked to 'functional section' using the field 'section code'. I assumed you could use the same row source, i.e. :

SELECT [Functional List].Code, [Functional List].[Section Code], [Functional List].Function FROM [Functional List] WHERE (([Functional List].Code)=[cbosection])) ORDER BY [Functional List].Code;

But when I put the criteria =[cbosection] in, the box just comes up blank.

This is the code I have used:

Private Sub cbogroup_AfterUpdate()
Me.cbosection = Null
Me.cbosection.Requery
End Sub

Private Sub cbosection_AfterUpdate()
Me.cbofunction = Null
Me.cbofunction.Requery
End Sub

Private Sub Form_Current()
Me.cbosection.Requery
Me.cbofunction.Requery
End Sub


Any ideas on where I'm going wrong?

Thanks!
Jul 13 '07 #1
8 2469
puppydogbuddy
1,923 Expert 1GB
Hi there,

I'm having trouble getting my 3rd dependent combo box to work in Access 2003.

I have three dependent boxes named cbogroup, cbosection and cbofunction. Each one is dependent on the selection made in the previous box. All of these appear on one form called 'records subform'.

The information for each box is taken from a different table. The first from 'functional group' which has only 2 fields: 'group' and 'group code'. The second box is populated from table 'functional section' which also contains the field 'group code' and this information is used to filter the choices for the second box. This is the row source for cbosection:

SELECT [Functional Section].[Section Code], [Functional Section].Section, [Functional Section].[Group Code] FROM [Functional Section] WHERE ((([Functional Section].[Group Code])=[cbogroup])) ORDER BY [Functional Section].[Section Code];

This works fine. However, my 3rd box won't play ball. The information is taken from table 'functional list' which is linked to 'functional section' using the field 'section code'. I assumed you could use the same row source, i.e. :

SELECT [Functional List].Code, [Functional List].[Section Code], [Functional List].Function FROM [Functional List] WHERE (([Functional List].Code)=[cbosection])) ORDER BY [Functional List].Code;

But when I put the criteria =[cbosection] in, the box just comes up blank.

This is the code I have used:

Private Sub cbogroup_AfterUpdate()
Me.cbosection = Null
Me.cbosection.Requery
End Sub

Private Sub cbosection_AfterUpdate()
Me.cbofunction = Null
Me.cbofunction.Requery
End Sub

Private Sub Form_Current()
Me.cbosection.Requery
Me.cbofunction.Requery
End Sub


Any ideas on where I'm going wrong?

Thanks!
Try commenting out what you have in the current event and test. If that leaves something out of synch, then requery the main form>>>>>Me.Requery<<<<<to bring everything in synch.
Jul 13 '07 #2
Cerian
5
Try commenting out what you have in the current event and test. If that leaves something out of synch, then requery the main form>>>>>Me.Requery<<<<<to bring everything in synch.

I'm sorry, I don't know what you mean by 'commenting out'!??
Jul 13 '07 #3
puppydogbuddy
1,923 Expert 1GB
I'm sorry, I don't know what you mean by 'commenting out'!??
Commenting out means place a single quote in the left margin to turn an executable statement into a non-executable comment as show below.

Private Sub Form_Current()
'Me.cbosection.Requery
'Me.cbofunction.Requery
End Sub

The above 2 requery statements will not be executed because they are commented out.
Jul 13 '07 #4
Cerian
5
Commenting out means place a single quote in the left margin to turn an executable statement into a non-executable comment as show below.

Private Sub Form_Current()
'Me.cbosection.Requery
'Me.cbofunction.Requery
End Sub

The above 2 requery statements will not be executed because they are commented out.
Thanks for your help on this. But no luck I'm afraid! Any other ideas?
Jul 13 '07 #5
Cerian
5
I'm not sure what I did, but I've somehow managed to solve the problem! Thanks for your help!

C
Jul 13 '07 #6
puppydogbuddy
1,923 Expert 1GB
I'm not sure what I did, but I've somehow managed to solve the problem! Thanks for your help!

C
Please post the code you have now, so that other newbies can see what the final working code looks like in comparison to your prior posts. Thanks.
Jul 13 '07 #7
Cerian
5
I don't think it was changing the code that solved the problem, I think it was down to a glitch with the relationship between my second and third tables.

I did have to tweek the code slightly so that when you change the first box, the third box becomes a blank again. It now reads:

Private Sub cbogroup_AfterUpdate()
Me.cbosection = Null
Me.cbofunction = Null
Me.cbosection.Requery
Me.cbofunction.Requery
End Sub

Private Sub cbosection_AfterUpdate()
Me.cbofunction = Null
Me.cbofunction.Requery
End Sub

Private Sub Form_Current()
Me.cbosection.Requery
Me.cbofunction.Requery
End Sub
Jul 13 '07 #8
puppydogbuddy
1,923 Expert 1GB
Thanks. This will give any interested party another idea of where to look for a possible cause for combo box problems.
Jul 13 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
4
by: Miguel | last post by:
I have an order entry database with two forms. One is for new orders the other is to update orders. The forms are identical except that one is strictly order entry. On both forms are three sets of...
5
by: NateDogg | last post by:
This is what I am using to filter my combo box based on what is selected in the previous box. Open the properties for the second combo box. Next to the 'Row Source' property, click on the '...'. ...
0
by: annivanova | last post by:
Hi, I saw posts in Dependent listboxes on access forms, which problem is very similar to my. I’m from Bulgaria and working over to create an MS Access application. I used in my project given code...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
2
by: Ruthenfods Tellez | last post by:
I have an application in asp; in my form I have a combo and a textbox, the combo is fill in from a database query. I cannot do the following: when selecting an item from the combo, it should send...
4
by: shreyansghia | last post by:
Hello , I ve a form which is based on a table viz SalesOrder. 1 of the field which Sales Order has is : Client. I ve 2 more tables, (a) Client which has 1 field viz ClientName , (b)...
1
by: avigiano | last post by:
Good morning. I have a contacts database that tracks the regular things like phone numbers, address etc. User searches for contacts through a combo box that lists entires by last name. I've...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.