473,729 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo box dependent on another combo box, text part is blank

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, not ID's, so I
have to convert the ID's from various lookup tables.

The combo boxes work fine except for subcategory, which is dependent on
category. Depending on category, the drop-down box for subcategory
will display different items. (for example, when Category is
Furniture, Subcategory will display drop-down list of 'Dresser,
Nightstand, Desk...". Without clicking on the drop-down box,
subcategory will display in its text area the Description of the
subcategory ID of the existing record on the table.

The drop-down list for Subcategory works fine. However, the text
portion is blank for records on the 2nd category. In other words,
there are 10 records for the first category, Accessories. Subcategory
displays fine for these. But for the 11th record and subsequent
records, subcategory is blank (text portion, although drop-down works
correctly).

If I just display subcategory ID, and not convert to description, it
works fine.

My SQL statement for subcategory is:
"SELECT ItemSubcatID, ItemSubcatDesc FROM tlkpItemSubcate gory
WHERE (((ItemCategory ID)=[Forms]![frmItems]![cboItemCategory]))
ORDER BY ItemSubcatDesc; "

Column count is 2, column width is 0, 2. Bound column is 1.
I think the problem lies around here. When I have column width =
"1,1", I can see that my subcatgegory ID is displayed correctly.

I do a requery of subcategory on category_afteru pdate and
category_change ... but the combo boxes drop-down part seem to be
working fine.

If I run just the query that's the record source, it displays
subcategories correctly.

What would cause the text portion of my combo box to be blank?

Thanks in advance for any help,
Lori

Dec 16 '05 #1
10 9572
You said the underlying query works fine when you run it by
itself...does each record in that query have a subcategory ID? Also, do
you have any records that have a subcategory ID but no text in
ItemSubcatDesc? When you ORDER BY a text field ascending, you get blank
fields first. For troubleshooting , you could change your ORDER BY to
ORDER BY ItemSubcatDesc DESC; and see if you get a better result.

Try making your column width something like four or five inches
(lengthen your combobox accordingly) to see if you simply have a couple
of records that have an awful lot of text for your current combobox
configuration. I realize you probably know exactly what's in your data
fields, but you never know what might pop up.

Dec 16 '05 #2
On 16 Dec 2005 08:54:15 -0800, "lorirobn" <lo******@yahoo .com> wrote:
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, not ID's, so I
have to convert the ID's from various lookup tables.

The combo boxes work fine except for subcategory, which is dependent on
category. Depending on category, the drop-down box for subcategory
will display different items. (for example, when Category is
Furniture, Subcategory will display drop-down list of 'Dresser,
Nightstand, Desk...". Without clicking on the drop-down box,
subcategory will display in its text area the Description of the
subcategory ID of the existing record on the table.

The drop-down list for Subcategory works fine. However, the text
portion is blank for records on the 2nd category. In other words,
there are 10 records for the first category, Accessories. Subcategory
displays fine for these. But for the 11th record and subsequent
records, subcategory is blank (text portion, although drop-down works
correctly).

If I just display subcategory ID, and not convert to description, it
works fine.

My SQL statement for subcategory is:
"SELECT ItemSubcatID, ItemSubcatDesc FROM tlkpItemSubcate gory
WHERE (((ItemCategory ID)=[Forms]![frmItems]![cboItemCategory]))
ORDER BY ItemSubcatDesc; "

Column count is 2, column width is 0, 2. Bound column is 1.
I think the problem lies around here. When I have column width =
"1,1", I can see that my subcatgegory ID is displayed correctly.

I do a requery of subcategory on category_afteru pdate and
category_chang e... but the combo boxes drop-down part seem to be
working fine.

If I run just the query that's the record source, it displays
subcategorie s correctly.

What would cause the text portion of my combo box to be blank?

Thanks in advance for any help,


I think you will find that your rowsource for the dependent combobox
is changed, on the fly, when you change the value of the combobox that
controls it.

When you modify the rowsource, you will find that any boxes which have
ID's that are no longer in the rowsource will display as blank. This
is because while Access can display the underlying data if the
combobox is bound and the bound column is being displayed (even if
there is no match), if anything other than the bound column is being
displayed since the bound column does not have a match, the rest of
the columns are "undefined" .

The "solution", such as it is (and it isn't a very good one) is to
ensure that any dependent comboboxes have their bound columns equal to
the information you wish to display on the screen.

mike
Dec 16 '05 #3
Hi. Thank you both for your replies.

Steve:
I have just checked, and:
--Each record in the underlying query has a subcategory ID.
--all records that have subcategory ID have text in subcategory desc.
--I am not getting blank fields first. I get description for the first
category, then blanks for the 2nd category.

Mike:
Unless I am misunderstandin g you, I don't actually actively change the
recordsource. The situation I describe is happening when the form is
initially being populated with values from the table. When it fills the
form with data, subcategory is filled in correctly for the first
category, then it's left blank when it is filling in data for the 2nd
category. I am not actually changing anything, just watching as the
form is being filled with data from the table. Does that make sense?

I am wondering if I am not correctly referencing the current CategoryID,
on this continuous form.

Thanks once again,
Lori


*** Sent via Developersdex http://www.developersdex.com ***
Dec 19 '05 #4
On Mon, 19 Dec 2005 20:41:12 GMT, Lorirobn <an*******@devd ex.com>
wrote:
Hi. Thank you both for your replies.

Steve:
I have just checked, and:
--Each record in the underlying query has a subcategory ID.
--all records that have subcategory ID have text in subcategory desc.
--I am not getting blank fields first. I get description for the first
category, then blanks for the 2nd category.

Mike:
Unless I am misunderstandin g you, I don't actually actively change the
recordsource . The situation I describe is happening when the form is
initially being populated with values from the table. When it fills the
form with data, subcategory is filled in correctly for the first
category, then it's left blank when it is filling in data for the 2nd
category. I am not actually changing anything, just watching as the
form is being filled with data from the table. Does that make sense?
Sure it does. Read my other post. Whether the rowsource is being
changed or whether it is only being applied once, the fact is that
only the values that match the rowsource can show up.

Look at your rowsource. You will probably find that the rows are
limited to the "first subcategory". That means that anything which
attempts to match anything not in the "first subcategory" will not
match and therefore show as the bound result (an ID field, typically,
but, as I said, if you change it to text, then the text will not be
lost when there is nothing to match).
I am wondering if I am not correctly referencing the current CategoryID,
on this continuous form.


mike
Dec 19 '05 #5
Hmmmm.... I think I am getting it. It sounds like the values are filled
in at one snapshot in time, and that's why there is no match for the 2nd
subcategory. (and yes, you are correct, rows are limited to the first
subcategory.) I thought it would check the values multiple times, for
each row being populated.

So, is there a way to do what I am attempting:
-- have a continuous form
-- have one combo box dependent on another
-- have the 2nd combo box display values during display of form that
correspond to 1st combo box's values FOR EACH ROW
???

thanks, Lori
*** Sent via Developersdex http://www.developersdex.com ***
Dec 20 '05 #6
On Tue, 20 Dec 2005 02:56:10 GMT, Lorirobn <an*******@devd ex.com>
wrote:
Hmmmm.... I think I am getting it. It sounds like the values are filled
in at one snapshot in time, and that's why there is no match for the 2nd
subcategory. (and yes, you are correct, rows are limited to the first
subcategory. ) I thought it would check the values multiple times, for
each row being populated.

So, is there a way to do what I am attempting:
-- have a continuous form
-- have one combo box dependent on another
-- have the 2nd combo box display values during display of form that
correspond to 1st combo box's values FOR EACH ROW
???


Only if the bound column for the combobox is displayed and not a
number.

mike
Dec 20 '05 #7
>>Only if the bound column for the combobox is displayed and not a
number.

ok, Mike, I can display the bound column for the combo box (which is not
a number). Then how do I proceed?

Just want to:
-- have the drop-down box selections dependent on the first combo box
value, and
-- display descriptions from lookup table in addition to ID's.

???
I am playing around and trying to figure it out, but so far no luck...

thanks,
Lori

*** Sent via Developersdex http://www.developersdex.com ***
Dec 20 '05 #8
On Tue, 20 Dec 2005 21:39:07 GMT, Lorirobn <an*******@devd ex.com>
wrote:
Only if the bound column for the combobox is displayed and not a
number.

ok, Mike, I can display the bound column for the combo box (which is not
a number). Then how do I proceed?

Just want to:
-- have the drop-down box selections dependent on the first combo box
value, and


You do this by changing the rowsource of the dependent combobox in the
after update routine of the first combobox.
-- display descriptions from lookup table in addition to ID's.


OK, this I don't understand. If you say that you will be displaying
descriptions that is fine. But what does "in addition to the ID's"
mean? That sounds like you are using the ID's as the bound column.
Hence, we are in an infinite loop. ;-)

mike

Dec 20 '05 #9
Hi Mike,
I will try my best to abort the infinite loop! ...
If you say that you will be displaying descriptions that is fine. But what does "in addition to the ID's" mean?
That sounds like you are using the ID's as the bound column.

What I meant was:
I was originally just displaying descriptions. But because you said I
could do what I wanted to do only if the bound column for the combo box
is displayed, that's when I thought "ok, then I will display the ID,
also". But, even when I was displaying descriptions, I did actually use
the ID's as the bound column. Is this not correct? Could that be the
cause of my problem? You can view my sql at the beginning of this
thread. It shows that I use the ID as my bound column.

I am afraid this is as clear as mud????
You do this by changing the rowsource of the dependent combobox in the

after update routine of the first combobox.

What do I change the row source to? I have been doing a requery.

Thanks once again. Hope it's clearer. Thanks for sticking through the
infinite loop with me.

Lori


*** Sent via Developersdex http://www.developersdex.com ***
Dec 21 '05 #10

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

Similar topics

8
18391
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". The values in the dropdown are loaded in the correct order, but the initial value is not the first row of the dropdown as I expected. The field "CategoryName" is not the primary key for the table -- the PK is
10
1908
by: Richard | last post by:
I have created a form which sets up a dataview. The form views one record at a time using a currencymanager. This works fine. All my text boxes bind. However I have a combo box which gets its lookup values from another (Advertising) table (AdvertisingID, Advertising). This works .. However, where it doesn't work as well is when the form loads, the combo boxes should bind to the AdvertisingID field and display the respective data.
6
11780
by: CindyH | last post by:
Hi Does anyone know how to create a multi column combo box from the same table? Thanks, Cindy
9
6760
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.
8
8260
by: salad | last post by:
I was wondering how you handle active/inactive elements in a combo box. Let's say you have a combo box to select an employee. Joe Blow has been selected for many record however Joe has left the company and has been flagged inactive. If you have a filter on the rowsource like Where Active = True then Joe's name would not show up in the combo list. This would be fine if the combo is associated with a field that is null/0. It would not be...
8
2201
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose Product where as the Row Source (See properties): SELECT tblProducts.ProductName, tblProducts.ProductName FROM tblProducts ORDER BY ProductName;
4
3032
by: Swinky | last post by:
I am trying to make a combo box dependent on a text box. I cannot get the combo box to pull the related data from the text box. I have been all over this user group & have tried several versions of code to no avail. I would like to display all contact names (in the combo box) related to the customer number in the text box. Here's what I have:
4
3477
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) ClientDetails which has 2 fields ClientName and Address. The tables are linked ( the link being client name) . This ofcourse means , a particular client could ve multiple addresses. Every time a sales order is excuted , the equipments need to be...
4
2187
by: deanndra | last post by:
First, I want to say thank you to Scott and the others who replied to my first post here. I had to put that database on hold for the moment when I was tasked with a new one. I am building another database from scratch. This one is for job announcements. I've built only 2 tables (I know this is a no-no, but it was demanded by those wanting this database so I've complied). The field name properties and data types in both tables are virtually...
0
8761
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
9426
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...
1
9200
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
8148
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
6722
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
6022
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
4525
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...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
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.