473,785 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading Combo/List Boxes help

53 New Member
Hi,

I've been through the tutorial for this and I've tried applying it to my database and it almost works but not quite.

i have 2 combo boxes, cboPrgrp and cboSupplier. cboPrgrp is supposed to populate once a selection is made for cboSupplier. When a selection is made in cboSupplier and I click the dropdown box for cboPrgrp, it will prompt me saying whatever the selection is in cboSupplier. If I type in what was selected in cboSupplier, then cboPrgrp will populate properly. My question is why is it prompting me?

Here is the code to populate cboPrgrp:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboSupplier_AfterUpdate()
  2. With Me![cboPrgrp]
  3. .RowSource = " "
  4. .RowSource = "SELECT DISTINCT [COMCOD] " & _
  5.                      "FROM dbo_ICI1 " & _
  6.                      "WHERE [SUPPLR] =" & Me!cboSupplier
  7. .Requery
  8. End With
  9. End Sub
  10.  
Note that [COMCOD] is what goes in cboPrgrp.

Anybody know why it's prompting me?
Jul 31 '07 #1
5 2508
JKing
1,206 Recognized Expert Top Contributor
Is the prompt specifying anything or are you just seeing "Enter Parameter Value"? This error is usually caused by typos as Access cannot determine which variable /control/field you are referring to.
Jul 31 '07 #2
RZ15
53 New Member
Is the prompt specifying anything or are you just seeing "Enter Parameter Value"? This error is usually caused by typos as Access cannot determine which variable /control/field you are referring to.
It says "Enter Paramater Value" in the caption of the box (the top bar of the box). Then it says whatever the selection is in cboSupplier and then it has a box for me to type something in. So if my selection in cboSupplier is "EPPUSA" It looks like this:

Enter Parameter Value|X|

EPPUSA_______________ _____
||_____________ ____________|

This is what I'm seeing.
Jul 31 '07 #3
JKing
1,206 Recognized Expert Top Contributor
Hehe I liked the visual, thank you. I think I know the problem.
Give this a try:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboSupplier_AfterUpdate()
  2. With Me![cboPrgrp]
  3. .RowSource = " "
  4. .RowSource = "SELECT DISTINCT [COMCOD] " & _
  5.                      "FROM dbo_ICI1 " & _
  6.                      "WHERE [SUPPLR] = '" & Me!cboSupplier &"'"
  7. .Requery
  8. End With
  9. End Sub
  10.  
Supplier is of the text data type. So you need to enclose it with the single quotes. I believe without them access assumes the value of your combo box to be an unknown variable.
Jul 31 '07 #4
RZ15
53 New Member
Hehe I liked the visual, thank you. I think I know the problem.
Give this a try:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboSupplier_AfterUpdate()
  2. With Me![cboPrgrp]
  3. .RowSource = " "
  4. .RowSource = "SELECT DISTINCT [COMCOD] " & _
  5.                      "FROM dbo_ICI1 " & _
  6.                      "WHERE [SUPPLR] = '" & Me!cboSupplier &"'"
  7. .Requery
  8. End With
  9. End Sub
  10.  
Supplier is of the text data type. So you need to enclose it with the single quotes. I believe without them access assumes the value of your combo box to be an unknown variable.
It works beautifully now, thanks bud :) .
Jul 31 '07 #5
JKing
1,206 Recognized Expert Top Contributor
No problem glad I could help.
Jul 31 '07 #6

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

Similar topics

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...
3
5345
by: Mike Jakes | last post by:
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 "BoatEventssubform". On this sub-form are two combo boxes, named...
9
6769
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the second combo to change depending on what values the user selects in the first box, it's just that every time the user changes the first combobox, the second combobox FOR EVERY RECORD goes blank.
4
64642
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...
7
2545
kcdoell
by: kcdoell | last post by:
I have three tables: One for the Division location: tblDivision DivisionID = Autonumber DivisionName = Text One for the Working Region: tblWrkRegion
4
3497
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields below. tblOrg OrgID, AutoNumber, PK ZipID, Number, FK tblState StateID, AutoNumber, PK
1
2674
kcdoell
by: kcdoell | last post by:
Good Morning: I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off: Procedure declaration does not match description of event or procedure having the same name. Basically have three tables: One for the Division location:
3
3988
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment list will 'display in the drop down list of CboSegment With Me! If IsNull(Me!cboDivision) Then
7
5840
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm currently trying to set up a whole pile of cascading combo boxes of different levels of complexity, so I started with the easiest set - and can't even get that to work (even using the tutorial on this site at...
0
9647
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
9485
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
10356
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
10161
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8986
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...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.