Multi-Column ComboBox DefaultValue

I have a combobox with 2 columns. When its form is displayed. I want it's text value to already have a default in it, but I'm not sure what the delimiter is. With one column the defaultvalue could be (ex. "Hello") but with two - doing (ex. "Hello"; "World") does not put "Hello" in the first column and "World" in the next.
tyy8Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BrianWrenCommented:
Is this combo bound to the recordsource of the form?  Where dow it get the information that is in the drop-down list?

Brian
0
tyy8Author Commented:
its recordsource is a sql statement
0
BrianWrenCommented:
What is the SQL?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

tyy8Author Commented:
I think your taking the details of the situation far, far away from the question.

How do you fill the combobox's text value if it has two columns in it??

The recordsource doesn't matter.
0
jschrismanCommented:
A combo box can only have 1 bound column. It only displays the first visible column from the dropdown box in the control.

Your best bet is to make the sql query for the combo box concatenate the two columns into one. Make that one column the first visible.
0
BrianWrenCommented:
OK, here's where I was going.

You cannot fill a combo box period.  All it has is its rowsource.

You can, however, position a combo box.

If there is a row in the rowsource of your combo box that has "Hello" in one column, and "World" in the other column, OF THE SAME ROW, then you can position the box on that row.

How that would be done depends intimately on how the rows are getting their data, hence the focus on the details.

Brian
0
JimMorganCommented:
tyy8:  I see where all the confusion is going on.  As I see it you want the combo box to default to a certain value.

If the combo box is bound, the default will only occur when you go to a new record.  If the default value is not one of the existing values in the combo box, it will not allow that setting unless the first field in the group is the bound field.  If the value does not exist and the not in list property is true, it will fuss that the value is not in the list.

Here are the scenarios:

If the default value is in the list, great!  You only need to have the first column in the default property.  That is what the field represents.  Forget the second value.  If you drop down the box, it will show up.

If the default value is not in the list and not-in-list is no, then there is no problem.

Same as last scenario but not-in-list is true, then you would have to create an union query with the first and second column values hand entered in the union query.  You still only need to have the first column value in the default box.

Jim
0
tyy8Author Commented:
Jim's correct, that works. Thanks to everyone.
0
JimMorganCommented:
Want to select a comment as the answer?  Click the message on the right side of the comment line.

You're welcome, tyy8.  Glad I could be of help.

Jim
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.