Dependent Combo Boxes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been scouring this website as well as another to find a solution to my
problem. After reading the posts regarding a Dependent Combo box I wonder if
this is what I need. (I have excellent Microsoft skills but am a beginner in
Access). I have a table that contains 2 fields: a complaint code and a
complaint description for that code. I am creating a data base for our
customer service complaint line and this form is for data entry where I want
the user to type in the code (3 char) and in another field the corresponding
complaint description comes up without typing it. I read in the Help screens
in Access that I can set it up so that if the code is typed in the
description can be viewed but I want both to appear. Any ideas on how this
can be done? I appreciate any help I can get.
 
This is relatively easy to do. First, make sure that the description field
is included in the rowsource query for your combobox. Then you will need to
create a textbox with an expression as the ControlSource. Just drag a
textbox control onto the form from the toolbox then in the controlsource
property you will put the following, replacing cboMyCombo with the name of
your combobox, and replacing 'n' with the field number in the query minus 1
(the column property is indexed starting at 0).

=cboMyCombo.column(n)

If your description field is the 2nd field in the combo, then you'd put:

=cboMyCombo.column(1)
 
Thank you so much!! I will try it out.

Sandra Daigle said:
This is relatively easy to do. First, make sure that the description field
is included in the rowsource query for your combobox. Then you will need to
create a textbox with an expression as the ControlSource. Just drag a
textbox control onto the form from the toolbox then in the controlsource
property you will put the following, replacing cboMyCombo with the name of
your combobox, and replacing 'n' with the field number in the query minus 1
(the column property is indexed starting at 0).

=cboMyCombo.column(n)

If your description field is the 2nd field in the combo, then you'd put:

=cboMyCombo.column(1)


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have been scouring this website as well as another to find a
solution to my problem. After reading the posts regarding a
Dependent Combo box I wonder if this is what I need. (I have
excellent Microsoft skills but am a beginner in Access). I have a
table that contains 2 fields: a complaint code and a complaint
description for that code. I am creating a data base for our
customer service complaint line and this form is for data entry where
I want the user to type in the code (3 char) and in another field the
corresponding complaint description comes up without typing it. I
read in the Help screens in Access that I can set it up so that if
the code is typed in the description can be viewed but I want both to
appear. Any ideas on how this can be done? I appreciate any help I
can get.
 
Thanks Ken - I printed the article and will look at it this evening. I
appreciate both of your help.
 
I'm trying to extend this a little further. I've got a table [tblPremises]
with two fields, [PremName] and [PremRef] and I'd like the [PremName] field
to be populated with all the unique entries in the [Premises] field of
another table used for data entry [tblDetails] which, when the [Premises]
field exactly matches the [PremName] field in [tblPremises] another field in
the [tblDetails] is populated with the [PremRef] value.

Simple, really ;-)

TIA,

Pete
 
See this article for "dependent combo boxes"
http://www.mvps.org/access/forms/frm0028.htm


--

Ken Snell
<MS ACCESS MVP>

Night Owl said:
I'm trying to extend this a little further. I've got a table
[tblPremises] with two fields, [PremName] and [PremRef] and I'd like the
[PremName] field to be populated with all the unique entries in the
[Premises] field of another table used for data entry [tblDetails] which,
when the [Premises] field exactly matches the [PremName] field in
[tblPremises] another field in the [tblDetails] is populated with the
[PremRef] value.

Simple, really ;-)

TIA,

Pete


Ken Snell said:
 
Works like a charm! Thanks so much for your help.

Sandra Daigle said:
This is relatively easy to do. First, make sure that the description field
is included in the rowsource query for your combobox. Then you will need to
create a textbox with an expression as the ControlSource. Just drag a
textbox control onto the form from the toolbox then in the controlsource
property you will put the following, replacing cboMyCombo with the name of
your combobox, and replacing 'n' with the field number in the query minus 1
(the column property is indexed starting at 0).

=cboMyCombo.column(n)

If your description field is the 2nd field in the combo, then you'd put:

=cboMyCombo.column(1)


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have been scouring this website as well as another to find a
solution to my problem. After reading the posts regarding a
Dependent Combo box I wonder if this is what I need. (I have
excellent Microsoft skills but am a beginner in Access). I have a
table that contains 2 fields: a complaint code and a complaint
description for that code. I am creating a data base for our
customer service complaint line and this form is for data entry where
I want the user to type in the code (3 char) and in another field the
corresponding complaint description comes up without typing it. I
read in the Help screens in Access that I can set it up so that if
the code is typed in the description can be viewed but I want both to
appear. Any ideas on how this can be done? I appreciate any help I
can get.
 
Back
Top