Combo Box Question

  • Thread starter Stacey Crowhurst
  • Start date
S

Stacey Crowhurst

Hi. I have a combo box in a form.

SELECT [Vendor - Directory].[Vendor ID], [Vendor - Directory].[Vendor Name]
FROM [Vendor - Directory] ORDER BY [Vendor Name];

It shows me the Vendor ID followed by Vendor Name. I have it set up to
store the vendor ID in the table the form connect to. Is there anyway that I
can have the combo box repsond to typing in the vendor name but still storing
the vendor ID in my table? I don't have the vendor name as a field in the
table and am not sure I want to add it.

Bascially, I want to be able to type 'M' and have it scroll down to the M's
so I can pick microsoft. Right now I have to manually sort since vendor ID
is the left column.

Hopefully this makes sense! Thanks :)
 
M

MGFoster

Stacey said:
Hi. I have a combo box in a form.

SELECT [Vendor - Directory].[Vendor ID], [Vendor - Directory].[Vendor Name]
FROM [Vendor - Directory] ORDER BY [Vendor Name];

It shows me the Vendor ID followed by Vendor Name. I have it set up to
store the vendor ID in the table the form connect to. Is there anyway that I
can have the combo box repsond to typing in the vendor name but still storing
the vendor ID in my table? I don't have the vendor name as a field in the
table and am not sure I want to add it.

Bascially, I want to be able to type 'M' and have it scroll down to the M's
so I can pick microsoft. Right now I have to manually sort since vendor ID
is the left column.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Set up the ComboBox properties like this:

Column Count: 2
Column Widths: 0";2"
Bound Column: 1

The Column Widths property indicates that the 1st column should not be
shown (0") and the name, column 2, should be shown in a 2 inch wide
display.

The Bound Column property indicates that the 1st column, the Vendor ID,
is the value that should be stored in the table.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSa2yKoechKqOuFEgEQJe7ACgnwPekzJ1JaDtiSgrJQ6eYTsXp1AAnAn9
XQoOq9LT3DlJeXDklviTRYXN
=rjlf
-----END PGP SIGNATURE-----
 
S

Stacey Crowhurst

Thank you for the explanation. Works great!

MGFoster said:
Stacey said:
Hi. I have a combo box in a form.

SELECT [Vendor - Directory].[Vendor ID], [Vendor - Directory].[Vendor Name]
FROM [Vendor - Directory] ORDER BY [Vendor Name];

It shows me the Vendor ID followed by Vendor Name. I have it set up to
store the vendor ID in the table the form connect to. Is there anyway that I
can have the combo box repsond to typing in the vendor name but still storing
the vendor ID in my table? I don't have the vendor name as a field in the
table and am not sure I want to add it.

Bascially, I want to be able to type 'M' and have it scroll down to the M's
so I can pick microsoft. Right now I have to manually sort since vendor ID
is the left column.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Set up the ComboBox properties like this:

Column Count: 2
Column Widths: 0";2"
Bound Column: 1

The Column Widths property indicates that the 1st column should not be
shown (0") and the name, column 2, should be shown in a 2 inch wide
display.

The Bound Column property indicates that the 1st column, the Vendor ID,
is the value that should be stored in the table.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSa2yKoechKqOuFEgEQJe7ACgnwPekzJ1JaDtiSgrJQ6eYTsXp1AAnAn9
XQoOq9LT3DlJeXDklviTRYXN
=rjlf
-----END PGP SIGNATURE-----
 
J

John W. Vinson

Hi. I have a combo box in a form.

SELECT [Vendor - Directory].[Vendor ID], [Vendor - Directory].[Vendor Name]
FROM [Vendor - Directory] ORDER BY [Vendor Name];

It shows me the Vendor ID followed by Vendor Name. I have it set up to
store the vendor ID in the table the form connect to. Is there anyway that I
can have the combo box repsond to typing in the vendor name but still storing
the vendor ID in my table? I don't have the vendor name as a field in the
table and am not sure I want to add it.

Bascially, I want to be able to type 'M' and have it scroll down to the M's
so I can pick microsoft. Right now I have to manually sort since vendor ID
is the left column.

Hopefully this makes sense! Thanks :)

Simply use the "Column Widths" property of the combo box to set the width of
the ID field to 0: e.g. ColumnWidths of

0";1.25"

Or, just reverse the order of the fields in the query and change the Bound
Column property to whichever column contains the ID that you want to store.

The autocomplete is based on the leftmost *VISIBLE* column in the combo; that
need not be the first column, nor need it be the bound column.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top