By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Programmically select specific row of combo box

P: n/a
Hello.

I have a form with a series 5 combo-boxes. All 4 contain the same
query which lists Parts based on a productID from a previous form.
i.e.

cboPart1 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart2 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart3 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart4 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart5 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID

Now when I open this form I want it to select a specific row for each
combo box

cboPart1 = Row1
cboPart2 = Row2
cboPart3 = Row3
cboPart4 = Row4
cboPart5 = Row5

The PartID stored in the 1st column can be any number becuase of the
filter so I just can't set its value to 1-5.

I need a way to say open the combo box and select a specific row.

Ideas methods?

Thanks in advance.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You could use the ComboBox property ListIndex (zero-based) in the
form's OnCurrent event procedure to set the ComboBoxes. E.g.:

cboPart1.ListIndex = 0
cboPart2.ListIndex = 1
cboPart3.ListIndex = 2
.... etc. ...

Also, see the Access help articles on ListIndex and ListCount.

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBP/zZZIechKqOuFEgEQKjjQCgi+U3B28RofEmjCqW5MOaOEuIiwoA oPC5
I6FWhaHlN9QZbHhrxqDF5Qtz
=lO+I
-----END PGP SIGNATURE-----
Ryann wrote:
Hello.

I have a form with a series 5 combo-boxes. All 4 contain the same
query which lists Parts based on a productID from a previous form.
i.e.

cboPart1 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart2 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart3 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart4 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID
cboPart5 = Part ID, Part, ProductID Where ProductID =
Form!frmName!cboProductID

Now when I open this form I want it to select a specific row for each
combo box

cboPart1 = Row1
cboPart2 = Row2
cboPart3 = Row3
cboPart4 = Row4
cboPart5 = Row5

The PartID stored in the 1st column can be any number becuase of the
filter so I just can't set its value to 1-5.

I need a way to say open the combo box and select a specific row.

Ideas methods?

Thanks in advance.


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.