How do I set a Default value for a Combobox?

David Ball

Registered User.
Local time
Today, 20:23
Joined
Aug 9, 2010
Messages
230
Hi,

I have a Combobox called cmbLevel and want to set a default value. The default I want is “Standard” and this is a value in the table that is the source for the combo box.
What would I need to put in the Expression Builder or the Default Value row of the Data tab in the Property Sheet?
Thanks very much
Dave
 
In the Property Sheet of the Combo Box on the Data Tab is where you enter the Default Value.
 
You need to put in the ID Number ("IDNo") as the default value.
attachment.php
 

Attachments

  • DefaultValue.jpg
    DefaultValue.jpg
    75.1 KB · Views: 9,008
Thanks so much, JHB, that was the missing bit of info I needed!
 
You're welcome, good luck. :)
 
Actually, it still doesn't work. The Combo Box is on my Form. When I enter a number, say 1, in the Default Value nothing appears in the combo box on the form unless I select a value.
 
Then post your database with some sample data, zip it + name of the form with problem and the control name.
 
Is that not only for new records.?


I use

Code:
ctrl.ItemData(n)
where n is the index number I want, generally 0


HTH



Actually, it still doesn't work. The Combo Box is on my Form. When I enter a number, say 1, in the Default Value nothing appears in the combo box on the form unless I select a value.
 
As Gasman has suggested, it depends on what the Bound Column of the Combobox is. If the Combobox is based on a Table that has a RecordID, the RecordID is usually assigned and included in the Combobox, even it you didn't deliberately include it, when you constructed it.

On the other hand, if the Combobox is based on a ValueList, this won't be the case. If this is the case, try simply entering Standard as the Default Value.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom