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

changing a combo box in vba

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
I need to change the properties of a combo box using vba.
Here is my code:

Combo4.RowSourceType = "Value List"
Combo4.DefaultValue = "1/1/1999"
Combo4.RowSource = "1/1/1999, 1/2/1999, 1/3/1999"

The combo box displays the default value as the quotient of 1/1999. It displays the other rows normally. No matter WHAT I do, it treats the default value as a number.

Please advise.
 
Perhaps this ?
With Me!Combo4
.RowSourceType = "Value List"
.RowSource = "1/1/1999, 1/2/1999, 1/3/1999"
.DefaultValue = """1/1/1999"""
End With

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, did you mean Semicolon?

.RowSource = "1/1/1999; 1/2/1999; 1/3/1999"
 
PHV, did you mean Semicolon?
I don't think the RowSource was the OP's problem ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I think you're right PHV.
My Mistake.
Thx!
 
PHV interpreted my question correctly. After alot of experiments, I found the correct syntax:

Forms![startup1]![Combo4].DefaultValue = "#1/1/1999#"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top