![]() |
Combobox with current date
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 |
Combobox with current date
What about this?
..ComboDay1.Value = Day(Now) Rick "bbussoloti" wrote in message ... 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 |
Combobox with current date
..ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the
focus first, but no good. "Rick Rothstein (MVP - VB)" escreveu: What about this? ..ComboDay1.Value = Day(Now) Rick "bbussoloti" wrote in message ... 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 |
Combobox with current date
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 "bbussoloti" wrote in message ... .ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the focus first, but no good. "Rick Rothstein (MVP - VB)" escreveu: What about this? ..ComboDay1.Value = Day(Now) Rick "bbussoloti" wrote in message ... 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 |
Combobox with current date
On 23 Nov., 19:45, bbussoloti
wrote: .ComboDay1.Value = Day(Now) doesn´t work either. I even tried to set the focus first, but no good. "Rick Rothstein (MVP - VB)" escreveu: What about this? ..ComboDay1.Value = Day(Now) Rick "bbussoloti" wrote in message ... 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- Skjul tekst i anførselstegn - - Vis tekst i anførselstegn - Try .ComboDay1.AddItem Day(Now) Regards Per |
Combobox with current date
Hi,
Try this one hopes it works ComboBox1.Value = Format(Now, "dd") ComboBox2.Value = Format(Now, "mm") ComboBox3.Value = Format(Now, "yyyy") |
All times are GMT +1. The time now is 02:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com