Combobox with current date

  • Thread starter Thread starter bbussoloti
  • Start date Start date
B

bbussoloti

Hi,
I have 3 combo boxes that corresponds to day, month and year. When the user
opens my form, those values should be automatically with the current day,
current month and current year, but also open to change it.
I can make the values to be changeable, but i can´t set those current date
values.
I tried with no success all of those below:

With insereForm
.Show
.ComboDay1.Value = Format(Now, "dd")
.ComboDay1.Value = Format(Date,"dd")
.ComboDay1.Value = Day
End With
 
..ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
focus first, but no good.



"Rick Rothstein (MVP - VB)" escreveu:
 
Exactly what is the ComboBox populated with and how did you populate it? And
which ComboBox are we talking about... on the worksheet from the Forms
Toolbar, on the worksheet from the Control Toolbar or on a UserForm from
within VBA?

Rick
 
.ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
focus first, but no good.

"Rick Rothstein (MVP - VB)" escreveu:





- Vis tekst i anførselstegn -

Try

.ComboDay1.AddItem Day(Now)

Regards

Per
 
Hi,

Try this one hopes it works

ComboBox1.Value = Format(Now, "dd")
ComboBox2.Value = Format(Now, "mm")
ComboBox3.Value = Format(Now, "yyyy")
 
Back
Top