AnsweredAssumed Answered

Setting Processbook Display time with VBA code off control datetime button

Question asked by tklatt on Dec 18, 2014
Latest reply on Mar 6, 2017 by abdulnaeem

Attached are a few images to help with my question.

 

I am attempting to create a date selection item and button to set the date and time for the Pi process book display. This would allow for someone to use a calender(from the time picker control 6.0) to select the date they want to look at the data, and then view the snapshot of the display at that given time, I do not need to range it because it is a table of data and not trends.


My first step was to create a Control button with  "Microsoft Data and Time Picker Control 6.0" and change the properties so it is "dd/MM/yyyy HH:mm" the only value typically changed will be the month and day so the time was put at the end since it will remain at 06:50 for any day.


The control button for the date time selector is working properly but i am not 100% sure how to utilize VBA code to set the current display time to the time selected in the "Microsoft Data and Time Picker Control 6.0" box.


I have made a control button "Microsoft Forms 2.0 CommandButton" that i can use as a selector but am still not sure how to write the code to make the display time change based on the command button selecting the time picker value.


Half put together idea of what i want to do



Sub CommandButton1_Click()

 

*code should set the display time equal to the DTPicker1.Value, not 100% sure but below is a semi relevant example i found.

 

 

(**example code found on wordpress.com on a semi similar example, not sure if it is at all what i need**)

Dim dtmDate As Date

dtmDate = DateValue(Me.DTPicker1.Value)

 

Me.DTPicker1.Value = dtmDate (does this grab date time or is there a way to combine, do i need to have two seperate pickers one for time and one for date?)

 

End Sub

 

 

 

 

If anyone can help with coding how to do this i would appreciate it, or potentially even a different method of easily selecting a date (always @ 06:50) without having to go up to the top and find the buttons to change date range.

 

 

Thanks for the help,

 

Trevor

Outcomes