Time Keeper (Punch Clock)

Issues with code implementation

Page 1 of 1

4 Replies - 13110 Views - Last Post: 22 May 2008 - 03:02 PM Rate Topic: -----

#1 digitalintell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-May 08

Time Keeper (Punch Clock)

Posted 14 May 2008 - 04:53 PM

Hello, I am new to this forum and I am having a brain cramp on how I can go about setting up my program (a sorta time card to keep track of my hours at work). My day consists of 4 punches. Start Time, Lunch Out, Lunch In, and Finish Time. I have setup on my form an array of Command Buttons (0-3) for each of those times using InputBox.

I'm just curious what would be the better approach for storing my times? Right now I have a select case for which button was pressed with an event in each to truncate the times without the "AM/PM" but it's still being stored to a variable. Then I am Storing just the hours and just the minutes to 2 other variables, "tmpHours" and "tmpMins".

Maybe this isn't the best approach, but that's why I joined.
Any ideas would be wonderful!

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Time Keeper (Punch Clock)

#2 jeronimo0d0a  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 146
  • Joined: 03-March 08

Re: Time Keeper (Punch Clock)

Posted 15 May 2008 - 09:38 AM

I would put a label to indicate whether you are in or out. You could save some error checking code. what happens when you try to clock in and you already are. I think I would streamline that with only one button. You could add a password or user ID though, that would be cool. If you really wanted to go crazy put a running total of your hours for the week, the day, percentage of a fourty hour week left... If you're getting the time and chopping the AM/PM, you should also make sure you don't leave before you get there. Oh, also, I think it is easier to convert everything to minutes or hours and only work with one datatype. Just some thougnts.
Was This Post Helpful? 0
  • +
  • -

#3 sam_benne  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 16
  • View blog
  • Posts: 733
  • Joined: 16-January 08

Re: Time Keeper (Punch Clock)

Posted 15 May 2008 - 12:52 PM

I have done something like this while ago where you can login and do the timing thing haven't got it no more but if you need some helpo I might be able to.
Was This Post Helpful? 0
  • +
  • -

#4 digitalintell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-May 08

Re: Time Keeper (Punch Clock)

Posted 15 May 2008 - 02:15 PM

Let's see here, you have a good idea with the running hours for the week and percentage etc..

If I converted everything to hours I'm positive there would be remainder time (minutes). I had an idea to just simply use text boxes for the times. They are more controllable than the basic InputBox feature. It's just been awhile since I've programmed so things are a tad blurry for me.

How important is the AM/PM when summing up times? Is it even necessary really? My clock in and clock out times are very similar very day.

You also mentioned

Quote

I think it is easier to convert everything to minutes or hours and only work with one datatype


My very first thought was to store all my variables in a Data type, but once again I am getting confused with the whole process of how I want this program to run.

Public Type Punch
	StartTime As String
	LunchOut As String
	LunchIn As String
	FinishTime As String
End Type

Public MyTimes As Punch



I will also need temp Variables to hold the duration of my lunch break and the duration of my day. Then I would be able to simply subtract one from the other to get the hours worked correct? I also don't even know if declaring the type variables as strings when working with time. I have seen people declare them as "Date", but chopping the hours and minutes from a string like, "12:45:32 PM" is a bit more complex than I need. I am actually not even incorporating seconds in this app. It's just to get a general scope for the work week, not exact.

Thanks for your feedback, I will look back soon for a follow up.
Was This Post Helpful? 0
  • +
  • -

#5 digitalintell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-May 08

Re: Time Keeper (Punch Clock)

Posted 22 May 2008 - 03:02 PM

Alright! So here I have an almost complete version of my WeeklyHours program. I am having problems saving my data to text files (assigned by the date) exactly how I list the data in the ListBox.

Here is my application if anyone would be willing to lend me a hand.

Thanks so much!

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1