Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Billing and time manipulation

Status
Not open for further replies.

A1ADiver

Programmer
Joined
Oct 26, 2000
Messages
2
Location
US
Does anyone have any suggestions? I need to develop a form that will allow the user to pick a client and then push a button so the clock starts running. I know I can do this by inserting the current date/time for the line entry. I also know I can repeat the same proceedure for stop time. What I need to do is be able to take either the start and stop time and round it to lets say the nearest quarter hour or ten minutes of the hour or calculate the time difference and then round up or down to either the nearest quarter hour or 10 minutes of the hour. It would be preferable to also write the time difference to the table. Basically this would be a time/billing managment tool for a client that I have. I am access proficient, but lack skills in Visual Basic. So please treat me as if I am 3 years old and explain with exceptional detail.

 
I am assuming the client will stay on this screen while the time is being measured. If so, create two command buttons called cmdStart cmdStop and select the event tab. If you click on the ellipses (...) to the right of the click and double click events it will generate code for you to handle these events.

For cmdStart code you would set a date/time field, variable or whatever to now(), a builtin function that returns the current date and time. Also, put in this line of code:

cmdStart.enabled = false
cmdStop.enabled = true

This will disable the start button while one is active and enable the cmdStop button to stop the process.

For cmdStop do the same for another field with now() so that you can collect the ending date and time. If you give a little bit more information about what you are trying to do, others can help you as you go forward.

Remember, now() returns a number where the integer portion is the number of days and the fractional portion is the number of seconds since midnight.

Good Luck!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top