Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems preselecting ComboBox value with semicolon delimited list

Status
Not open for further replies.

WantsToLearn

Programmer
Feb 15, 2003
147
US
I have a combobox bound to a semicolon delimited list. Here is an example of the data:

0;04/12/2004;1;04/13/2004

The problem is the combo box displays empty and you have to click the drop down arrow to see the values. I need to have it display the first item in the list. I have tried all of the following and get an error every time:

BoundColumn = 0, combobox.value = 0 or combobox = 0 or combobox.default = 0

BoundColumn = 1 with all of the above. If I try to use ListIndex I also get an error. Am I having a major brain cramp here or has something changed in Access? Thanks!
 
Have you tried to set the focus to the combo before setting it's ListIndex property ?
BTW, the BoundColumn property must be 0.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
How are ya WantsToLearn . . . . .

Your talking the [blue]Default Value[/blue] of the ComboBox.

First, in design view, set the [blue]Default Value[/blue] property to the proper [purple]Index[/purple]. The [purple]Index[/purple] is a number from 1 (One), to the number of records in the list. This [blue]Default Value[/blue] is used when you open the form or goto a new record.

Next, any where you desire, use the following code to reset the default to what you want:
Code:
[blue]Me![u]ComboBoxName[/u].[purple]DefaultValue[/purple] = [purple]Index[/purple][/blue]
The Idea, is to make a selection from the ComboBox, run your code to do whatever, and reset the [purple]DefaultValue[/purple] as prescribed above.

cal.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top