Creating forms w/combo boxes

C

cadman

I have created a form that has numerous drop down boxes. One of these boxes
I would like to have populated automatically when four other boxes have been
populated.

ie: The four drop down boxes are labeled; Sec, Tap, Hole, Pole. The box
that I want to have auto populated is labeled SecTapHolePole. If the
previous drop downs have a selection of 01(sec), 02(tap), 234(hole),
234(pole) the auto populated box should show; 01-02-234-234.

So the question is what do I need to do in the form to get the information
to look how I want?

Thanks for the help
 
B

Beetle

I would suggest using a calculated text box, not a combo (drop down) box,
to concantenate the values from the first four combo boxes. Since I don't
know your circumstances, I'll suggest two different ways you could do
the concantenation.

You could use the & operator, and the control source of the text box
would look like;

=[Sec] & "-" & [Tap] & "-" & [Hole] & "-" & [Pole]

The potential drawback with using the & operator is that if any of the
combo boxes are Null, the dashes will still appear, so if there were no
selections in any of the combo boxes, your text box would display ---.

If that won't work for you, you could try using the + operator instead;

=[Sec] + "-" + [Tap] + "-" + [Hole] + "-" + [Pole]

The potential drawback here is that if any of the combo boxes are Null
the text box will also be Null (blank). It won't display the result until
ALL of the combo boxes have a value.

If you are using a Continuous form, then the calculated text box approach
probably isn't going to work at all. In that case you might be able to do
the concantenation in a query field, use the query as the record source of
your form, and use the concantenated query field as the control source of
the text box.
 

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