I need to fill a combobox based the current day - 1 to 30
for example current day=16/07/2022
15/07/2022 (is the current day-1)
16/07/2022
...
14/08/2022
fill combobox with particular condition
-
- PlatinumLounger
- Posts: 4556
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 79928
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: fill combobox with particular condition
Code: Select all
Dim d As Date
For d = Date - 1 To DateAdd("m", 1, Date) - 2
Me.ComboBox1.AddItem Format(d, "dd/mm/yyyy")
Next d
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4556
- Joined: 26 Apr 2010, 17:36
Re: fill combobox with particular condition
great!HansV wrote: ↑16 Jul 2022, 09:34Code: Select all
Dim d As Date For d = Date - 1 To DateAdd("m", 1, Date) - 2 Me.ComboBox1.AddItem Format(d, "dd/mm/yyyy") Next d