Combo box displaying text field values

A

Angel G

I would like to create a combo box that will display the values of a text
field pertaining to a selecte Item.
I have a table called TestSeries that contains a partNumber field and a
Series text box where an administartor will enter the number of intervals
that the partnumber needs to be tested on (0,3,6,9,12,15). Then I have a
results table that stores the tests data along with the test series number.
Can anyone provide a sample code to do this using a combo box in a form?
I was thinking something like:
Select Series
FROM TestSeries
WEHERE (PartNumber = form![Myform]!PartNumbercbx.value)
Unfortumatelly this will give me the Text box containing all the numbers
(0,3,6,9,12,15) as one row, but I would like it to display as a drop down
displaying one row per value, so that the user can select one number only.
 
C

Carl Rapson

Angel G said:
I would like to create a combo box that will display the values of a text
field pertaining to a selecte Item.
I have a table called TestSeries that contains a partNumber field and a
Series text box where an administartor will enter the number of intervals
that the partnumber needs to be tested on (0,3,6,9,12,15). Then I have a
results table that stores the tests data along with the test series
number. Can anyone provide a sample code to do this using a combo box in a
form?
I was thinking something like:
Select Series
FROM TestSeries
WEHERE (PartNumber = form![Myform]!PartNumbercbx.value)
Unfortumatelly this will give me the Text box containing all the numbers
(0,3,6,9,12,15) as one row, but I would like it to display as a drop down
displaying one row per value, so that the user can select one number only.

If possible, you need to re-think your table design. You should never store
multiple values in a single field; instead, create a table that contains
multiple records for the partNumber, one interval per record. You can then
populate a combo box using that table, after the partNumber is selected.

If a re-design isn't possible, you might be able to use Split to create an
array of interval values and use that array to populate the combo box. I
don't use Split much myself, but others might be able to give you more
information. Look in online help also.

Carl Rapson
 

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