473,327 Members | 2,112 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,327 software developers and data experts.

Cascading Combo/List Boxes help

53
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 2480
JKing
1,206 Expert 1GB
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
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 Expert 1GB
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
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 Expert 1GB
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
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 ...
3
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...
9
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...
4
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...
7
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
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...
1
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...
3
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...
7
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.