Hello,
I have several DateTimePickers on my form (formatted as time) and would like to populate each of them based on the current hour.
e.g. If I open the form at 10:22 AM I would lke the datetimepickers to show 10:00.
In my own mind, the code below is the sort of thing I'm after :
However I get a message about groupbox1 not being a collection type.Code:Dim d As DateTimePicker For Each d In GroupBox1 d.Value = Date.Today & " " & Hour(Now) & ":00" Next
I assume there is a way of doing what I want ?




Reply With Quote