dbTalk Databases Forums  

Form with dependent comboboxes

comp.databases.ms-access comp.databases.ms-access


Discuss Form with dependent comboboxes in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff Norville
 
Posts: n/a

Default Form with dependent comboboxes - 01-25-2012 , 12:32 AM






Hello,

I have a specific problem with a continuous form, dependent comboboxes, andhiding key values. After a little googling this might simply be a buggy area of Access - but I wonder if someone's solved this issue.

Mine is a dataview (continuous) form in Access 2007 with linked combo boxes.. User is presented with a form bound to a table of existing data; on selecting a new first fields - ex. Category - a subset is selected in field 2, Item. The bound table has only the ID values, CategoryID, ItemID.

Rowsource of the second combobox selects on the contents of the first selected box as it narrows the user's choices. The contents of the second box are generated by a query with a WHERE condition of the first control's boundID field.

All works fine when I display the key of the Item (ItemID) in addition to ItemShortName and ItemDescription -- all records have values. But my goal is to hide ItemID, showing the short name which is more useful (otherwise User needs to click the control to see short name etc). But when I make the width of that field 0, which SHOULD work, most of the data disappear too. It seems as if I am asking too much of the form to display anything but thebound value -- but I don't see any documentation saying this does not work..

For example, the record source of combobox for the second field shows all data items as such:
CategoryName | ItemID > ItemName | ...

....the form displays this in the default view:
Fruit | ItemID1 (Apples)
Fruit | ItemID2 (Oranges)
Fruit | ItemID5 (Kumquats)
....and the user can drop down the ItemID control for more choices.

However, if I modify the record source of combobox for the second field to hide the ID field and only show ItemName I get an assortment of blank controls:
CategoryName | ItemName | ...

Fruit | Apples
Fruit |
Fruit |
....now I lose Oranges and most of the ItemID controls have no label, which is a little alarming.

MS example for dependent control boxes:
http://www.microsoft.com/download/en...ng=en&id=24692

A promising example that doesn't seem to work:
http://www.blueclaw-db.com/download/..._combo_box.htm

I've a feeling I am missing something obvious. Happy to go into more detail (there's a little VBA identical to the MS example) if someone feels they have an insight.

Thanks!

Reply With Quote
  #2  
Old   
Bob Quintal
 
Posts: n/a

Default Re: Form with dependent comboboxes - 01-25-2012 , 05:02 AM






Jeff Norville <jnorville (AT) gmail (DOT) com> wrote in
news:3330719.4070.1327473153939.JavaMail.geo-discussion-forums@yqkm20
:

Quote:
Hello,

I have a specific problem with a continuous form, dependent
comboboxes, and hiding key values. After a little googling this
might simply be a buggy area of Access - but I wonder if someone's
solved this issue.

Mine is a dataview (continuous) form in Access 2007 with linked
combo boxes. User is presented with a form bound to a table of
existing data; on selecting a new first fields - ex. Category - a
subset is selected in field 2, Item. The bound table has only the
ID values, CategoryID, ItemID.

Rowsource of the second combobox selects on the contents of the
first selected box as it narrows the user's choices. The contents
of the second box are generated by a query with a WHERE condition
of the first control's bound ID field.

All works fine when I display the key of the Item (ItemID) in
addition to ItemShortName and ItemDescription -- all records have
values. But my goal is to hide ItemID, showing the short name
which is more useful (otherwise User needs to click the control to
see short name etc). But when I make the width of that field 0,
which SHOULD work, most of the data disappear too. It seems as if
I am asking too much of the form to display anything but the bound
value -- but I don't see any documentation saying this does not
work.

For example, the record source of combobox for the second field
shows all data items as such: CategoryName | ItemID > ItemName |
...

...the form displays this in the default view:
Fruit | ItemID1 (Apples)
Fruit | ItemID2 (Oranges)
Fruit | ItemID5 (Kumquats)
...and the user can drop down the ItemID control for more choices.

However, if I modify the record source of combobox for the second
field to hide the ID field and only show ItemName I get an
assortment of blank controls: CategoryName | ItemName | ...

Fruit | Apples
Fruit |
Fruit |
...now I lose Oranges and most of the ItemID controls have no
label, which is a little alarming.

MS example for dependent control boxes:
http://www.microsoft.com/download/en...playlang=en&id
=24692

A promising example that doesn't seem to work:
http://www.blueclaw-db.com/download/...dent_combo_box.
htm

I've a feeling I am missing something obvious. Happy to go into
more detail (there's a little VBA identical to the MS example) if
someone feels they have an insight.

Thanks!

Instead of modifying the rowsource, change the Column Width property
of the combobox to have the ID field column be 0".

--
Bob Q.
PA is y I've altered my address.

Reply With Quote
  #3  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: Form with dependent comboboxes - 01-25-2012 , 09:02 AM



On Jan 25, 12:32*am, Jeff Norville <jnorvi... (AT) gmail (DOT) com> wrote:
Quote:
Hello,

I have a specific problem with a continuous form, dependent comboboxes, and hiding key values. *After a little googling this might simply be a buggy area of Access - but I wonder if someone's solved this issue.

Mine is a dataview (continuous) form in Access 2007 with linked combo boxes. *User is presented with a form bound to a table of existing data; on selecting a new first fields - ex. Category - a subset is selected in field2, Item. *The bound table has only the ID values, CategoryID, ItemID.

Rowsource of the second combobox selects on the contents of the first selected box as it narrows the user's choices. *The contents of the second box are generated by a query with a WHERE condition of the first control's bound ID field.

All works fine when I display the key of the Item (ItemID) in addition toItemShortName and ItemDescription -- all records have values. *But my goal is to hide ItemID, showing the short name which is more useful (otherwise User needs to click the control to see short name etc). *But when I make the width of that field 0, which SHOULD work, most of the data disappear too. *It seems as if I am asking too much of the form to display anythingbut the bound value -- but I don't see any documentation saying this does not work.

For example, the record source of combobox for the second field shows alldata items as such:
CategoryName | ItemID > ItemName | ...

...the form displays this in the default view:
Fruit | ItemID1 (Apples)
Fruit | ItemID2 (Oranges)
Fruit | ItemID5 (Kumquats)
...and the user can drop down the ItemID control for more choices.

However, if I modify the record source of combobox for the second field to hide the ID field and only show ItemName I get an assortment of blank controls:
CategoryName | ItemName | ...

Fruit | Apples
Fruit |
Fruit |
...now I lose Oranges and most of the ItemID controls have no label, which is a little alarming.

MS example for dependent control boxes:http://www.microsoft.com/download/en...aylang=en&id=2...

A promising example that doesn't seem to work:http://www.blueclaw-db.com/download/..._combo_box.htm

I've a feeling I am missing something obvious. *Happy to go into more detail (there's a little VBA identical to the MS example) if someone feels they have an insight.

Thanks!
If I understand you correctly when you select the combo it appears all
items in the in the screen display the same value. You might want to
consider a dbl-click event to present a form where a person can
select the combo values. You values won't change if you use that
method.

Reply With Quote
  #4  
Old   
Jeff Norville
 
Posts: n/a

Default Re: Form with dependent comboboxes - 01-26-2012 , 12:04 AM



Sorry my explanation was unclear -- that's what I've done, and appears to be what causes the problem. When I set that field width to 0 I lose the data shown on that control on loading.

The odd bit is ALL the ID fields show when the width is greater than 0 -- so the form works.

More odd, not all of the Item controls show blank -- one ItemName does show where it should. The rest are blank. It looks as if I have bound the entire form to filter on one ID but I haven't. Knowingly anyway.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.