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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default value for combo box

Status
Not open for further replies.

spottednewt

Programmer
Jun 15, 2004
10
US
I am trying to set the default value of a combobox in a form to be the previous record's value. I used the following code under the Got Focus Event with numeric fields and it worked just fine.

Me.numeric_field.DefaultValue = Me.numeric-field.Value

But when I try to set the default value of the combo box this way, or in any way other than typing the actual value into the default box under properties, I get a #Name? error.

The combo box is a text field with two lookup values.

Any ideas as to what I'm doing wrong?
 
Should work. If it is a text field though you may need to add parentheses

Me.cmboSelect.defaultValue = "'" & Me.txtBxValue & "'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top