LANDesk Time Control

BrettM

just a pert, "ex" to come
Local time
Tomorrow, 03:25
Joined
Apr 30, 2008
Messages
134
I have been playing around with a way of having an employee select their start or finish time from a combobox that references the current time and shows time options in 15 minute incriments.

The nearest thing I have found is the ActiveX LANDesk Time Control. It displays what I need but I can see no way of getting the data it has back into a control on my form.

Can anyone assist?

Better yet, is there a cleaner way to do this?

Regards Brett
 
You can use a "normal" combobox using some code to fill the source of that combobox... You can put whatever data you want/need in what ever format you want...
 
I appreciate your reply namlian but you really don't tell me much. Firstly I need to read Time(). Convert it to the nearest 15 minute interval (10:41 = 10:45). Then display a continous range of times before and after the current converted time. Using "some code" to generate this is somewhat simplifying the operation. If I have to go to that trouble then sobeit however the ActiveX LANDesk Time Control does all this automatically and looks quite elegant. The only issue I have is that I cannot parse the result from the control to anything. There seems no way to bind that particular object.

Any ideas?
 
I dont know that object so I dont know how to bind it...

Creating a loop to round any time to 15 mins and get some adjoining timeframes is quite easy.
Format(CInt(Time() / #12:15:00 AM#) * #12:15:00 AM#, "HH:MM:ss")
This rounds your current time down to the closes 15 minutes prior to the current time (45 minutes curently.

Now stick a loop around it and you have the times from x period before and x period after the current time
Code:
Sub test999()
    Dim X As Integer
    Debug.Print Time()
    For X = -4 To 4
        Debug.Print Format(CInt(Time() / #12:15:00 AM#) * #12:15:00 AM# + X * #12:15:00 AM#, "HH:MM:ss")
    Next X
End Sub
Now instead of Printing the result stick it into the combobox, alter the -4 and 4 to any value you see needed.

Good luck!
 
I am trying to accomplish the same thing "parse information from the control to a text box" any suggestions?

Thanks:confused:
 
My suggestion re the LANDesk control is DONT. A third party control is nothing but trouble.

namliam had the basics for an answer for me.
Code:
    Dim X As Integer
    Debug.Print Time()
    For X = -4 To 4
        Debug.Print Format(CInt(Time() / #12:15:00 AM#) * #12:15:00 AM# + X * #12:15:00 AM#, "HH:MM:ss")
    Next X

I took it a few steps forward and set a start and finish time (stored in my variables table) for the dropdown along with 15 minute incriments.

Code:
Private Sub ctlName_GotFocus()
    z = Val(Left(Nz(DLookup("start", "tblVariables")), 2)) * 4
    If Right(Nz(DLookup("start", "tblVariables")), 2) = 0 Then z = z - 1
    If Right(Nz(DLookup("start", "tblVariables")), 2) = 30 Then z = z + 1
    If Right(Nz(DLookup("start", "tblVariables")), 2) = 45 Then z = z + 2
    y = (DateDiff("n", Nz(DLookup("start", "tblVariables")), Nz(DLookup("end", "tblVariables"))) / 15) + 1
    ctlName.RowSource = ""
    For x = 1 To y
        ctlName.AddItem Item:=Format((z + x) * #12:15:00 AM#, "H:mm")
    Next x
End Sub
Possibly not as elegant as it could be but it works for me.
Hope this stears you in the right direction.

Regards Brett
 
I will give this a shot.... Quick description of what I am doing. I will need both start and finish times that a user can select times from. I will then calculate the difference between the two. The purpose is to provide these 2 controls to shorten the amount of time it takes to complete a trouble ticket for repair. The calculated time will be the techicians repair time. I will use the code you provided to see how it looks and funtions... hopefully it is what I need.
 
BrettM - Thanks for you input, much appreciated. It will be 3 days before I get back to work but have been looking at this thread and wanted to add a little. I have no need to round any figures the technicians will select specific times.. just simply saving time for the tech they could enter 40 repairs a day.

Thanks, JIMR
 
I have been recommended to use the Microsoft date time picker control but it is not available on my PC. Does anyone know if it is available for download anywhere on the web? This process would be much easier for me by using a control. Sorry BrettM, I am too green at code and unable to filter thru your code to work with my DB.

Suggestions
 

Users who are viewing this thread

Back
Top Bottom