473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calculate time on form with 4 shifts, lunch, and total on Access Form

I'm having a very hard time calculating time on an access form. I have the following fields:

Shift1Start
Shift1End

Shift2Start
Shift2End

Shift3Start
Shift3End

Shift4Start
Shift4End

Lunch

TotalHours

The times entered above are on textboxes using medium time format (HH:MM AM or HH:MM PM). They do not cross over to the next day, they are all within one work day.

My goal is to get the "TotalHours" field to display a total time of the shifts, minus the "Lunch" field. TotalTime needs to be displayed in HH:MM AM/PM format.

I have tried:

Expand|Select|Wrap|Line Numbers
  1. =([Shift1End]-[Shift1Start])*24
Just to test before proceeding to attempt including the rest of the shifts, but I get the TotalHours field to display the time in decimal value. I have tried all kinds of variations but cannot nail the correct sintax/combination. I'm placing the code in the Control Source of the TotalHours field...

If anyone can please give me a hand would this I would really appreciate it.

In advance, Thank You!
Mar 12 '15 #1

✓ answered by jforbes

Sounds like it's working. 1.25 hours - 4 hours = -3.75 hours.

Check out line 19. That's where Lunch is taken in consideration. You'll have to decide how you want to address that you are entering in four different shifts and then only one entry for Lunch. I put in a multiplier of four so that the one Field would apply to all four shifts. So, either three more Lunch TextBoxes need to be added, it's fine the way it is and maybe put a note on the Form letting the user know what is going on, or lastly, you could inspect each Shift and subtract a Lunch only if there is time entered against the shift.

Here is another version of the code where Lunch is only subtracted when a Shift has time against it.
Expand|Select|Wrap|Line Numbers
  1. Private Sub doPaint()
  2.  
  3.     Dim lTime As Long
  4.     Dim lTemp As Long
  5.     Dim lLunch As Long ' Long Lunch, Cracks me up
  6.  
  7.     ' Calculate Time in Minutes
  8.     lTime = 0
  9.     lLunch = (Nz([Lunch], 0) * 60)
  10.  
  11.     ' First Shift
  12.     lTemp = (Nz(DateDiff("n", Me![Shift1Start], Me![Shift1End]), 0))
  13.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  14.  
  15.     ' Second Shift
  16.     lTemp = (Nz(DateDiff("n", Me![Shift2Start], Me![Shift2End]), 0))
  17.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  18.  
  19.     ' Third Shift
  20.     lTemp = (Nz(DateDiff("n", Me![Shift3Start], Me![Shift3End]), 0))
  21.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  22.  
  23.     ' Fourth Shift
  24.     lTemp = (Nz(DateDiff("n", Me![Shift4Start], Me![Shift4End]), 0))
  25.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  26.  
  27.     ' Format and Display
  28.     Me.txtTotalHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  29.  
  30. End Sub
  31.  
One last thing, I used Round() instead of Fix() in the formatting portion. That was a mistake. Fix() is equivalent to truncating the value, which is what should be used in this case.

32 1544
jforbes
1,107 Expert 1GB
Are you using Unbound Fields? Or are you Bound to fields with a Date/Time Datatype? Are you getting an Error? What is it that is not working for you?

This part confused me:
My goal is to get the "TotalHours" field to display a total time of the shifts, minus the "Lunch" field. TotalTime needs to be displayed in HH:MM AM/PM format.
I would think the total time would be a Number and not a Formated Date/Time.

I think what you have, formula wise, will work against bound Controls, at least if the day is the same for both the start and end.
You may want to consider using the DateDiff() function. DateDiff() works on Dates and can work on Strings:
Expand|Select|Wrap|Line Numbers
  1. ?DateDiff("s", "8:00am", "3:30pm")/3600
  2. >7.5
Mar 12 '15 #2
@jforbes
Hi jforbes, thanks for your reply,

Yes, the start, end, and Lunch fields are bound, but the totalhours field will not, as it will just soppose to calculate the total, and I need it to show in HH:MM hours and minutes, so if the total hours worked totals to three hours and twenty minutes it should show as 02:20 or 2:20...

I tried DateDiff, but was not successful, how would I pluck my fields into your suggestion above?

Thanks again,

Alex
Mar 12 '15 #3
jforbes
1,107 Expert 1GB
Ahh, now I understand what you are wanting for the Time Format. I think you will get what you want for this by changing the Format property for your TotalHours to "Short Time". You can accomplish the same thing in the ControlSource of TotalHours, but I think it's slightly better to have the Value of the Control as a numerical value instead of the String. That's getting nit picky on my part and you should do it however works best for you.

I think this would work for you as the ControlSource for TotalHours to start with:
Expand|Select|Wrap|Line Numbers
  1. =(DateDiff("s",[Shift1Start],[Shift1End])/86400)
What it does is gives you the percentage of a day. A Full day of 24 hours would equal a 1. So, 6 hours is 1/4 of a day or (1/24)*6=.25.

To include the Lunch calculation, you'll want something like this:
Expand|Select|Wrap|Line Numbers
  1. =((DateDiff("s",[Shift1Start],[Shift1End])-([Lunch]*3600))/86400)
You'll also need to put in the other Shifts. =)

As well as you may need to put in a Me.Recalc on some of your AfterUpdate Events. Putting in a Formula like this is a bit different in Access vs Excel and Access won't always catch the times it needs to recalc.

Good luck
Mar 12 '15 #4
@jforbes
When I set format to Short Time it shows "0:00" in TotalHours regardless of the start and end time, if I don't, it shows "-3600. If I factor in the lunch, it forces me to populate the lunch field, response is "0:00" with Short Time Format regardless of times and with no format it changes to, for example if times are start "01:00 AM" and end "02:00 AM" total displayed is "-75600".
Mar 12 '15 #5
jforbes
1,107 Expert 1GB
The number that is created for TotalHours, should be between Zero and One. I'm guessing there is a minus sign instead of a division sign, like this:
Expand|Select|Wrap|Line Numbers
  1. =(DateDiff("s",[Shift1Start],[Shift1End])-86400)
instead of:
Expand|Select|Wrap|Line Numbers
  1. =(DateDiff("s",[Shift1Start],[Shift1End])/86400)
Once the number is between Zero and One, I believe the Format will start working correctly.

Then, to deal with the Lunch needing to be populated, you can deal with it in multiple ways. You can Default it on a new record, even if it is Zero. Of you can deal with it by using a Nz() to give you a Zero incase it is Null. Sorta like:
Expand|Select|Wrap|Line Numbers
  1. =((DateDiff("s",[Shift1Start],[Shift1End])-(Nz([Lunch], 0)*3600))/86400)
  2.  
Mar 12 '15 #6
@jforbes
Hi jforbes,

I'm going crazy with this thing, lol... I had a few parenthesis missing, didn't realize... Now I got it working fine with just one shift. If I factor in the Lunch the results are erratic... I could not get it to work with the field bound, and if I unbind and format to short time on say Start 01:00 AM and End 02:15 AM with a "0:30" Lunch, the Total displays "1:13"... The lunch field cannot be unbound because the employee record would not reflect that lunch time (unless there is another way to save it)... The other dilemma is factoring in the other shifts, but I guess we'll cross that bridge when we get there, if I can get one shift with lunch working at least we have an idea and can tweaq from there...

Thanks again for your continued help on this, really appreciate it...!
Mar 13 '15 #7
jforbes
1,107 Expert 1GB
I can understand your frustration. Getting it all to work on the Form without resorting to VBA is a bit of a magic trick.

If it is getting to you, you can do all this through VBA. It would give you greater control and you could also debug it to see what it is doing.
Mar 13 '15 #8
@jforbes
If you can help me with that it would be FANTASTIC!!!. I just thought this was the only way to get it to work "live", meaning you get the results as you type into the fields and not have to wait for the record to be saved to see it...
Mar 13 '15 #9
jforbes
1,107 Expert 1GB
This is pretty straight forward. I built this function from the code above with a couple differences:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.     Call doPaint
  3. End Sub
  4.  
  5. Private Sub Shift1Start_AfterUpdate()
  6.     Call doPaint
  7. End Sub
  8.  
  9. Private Sub doPaint()
  10.  
  11.     Dim lTime As Long
  12.  
  13.     ' Calculate Time in Minutes
  14.     lTime = 0
  15.     lTime = lTime + (Nz(DateDiff("n", Me![Shift1Start], Me![Shift1End]), 0))
  16.     lTime = lTime + (Nz(DateDiff("n", Me![Shift2Start], Me![Shift2End]), 0))
  17.     lTime = lTime + (Nz(DateDiff("n", Me![Shift3Start], Me![Shift3End]), 0))
  18.     lTime = lTime + (Nz(DateDiff("n", Me![Shift4Start], Me![Shift4End]), 0))
  19.     lTime = lTime - ((Nz([Lunch], 0) * 60) * 4) ' Times four for four Employees... maybe have four seperate instances of Lunch?
  20.  
  21.     ' Format and Display
  22.     Me.txtTotalHours.Value = Right("00" & Round(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  23.  
  24. End Sub
The first difference is I switched to minutes instead of seconds as it seemed to make more sense.
Second is the use of NZ() to deal with Nulls. I mentioned this, but actually included it here.
Third was moving away from the Format on the TextBox. You'll need to make sure the Format is removed as well as making sure there is no ControlSource for the TotalHours TextBox. Since we are in VBA, we have additional options. The sample above may look a bit weird at first, but it is pretty trustworthy.

After you get your own version of the function and have it getting info from all the right fields and updating the TotalHours TextBox, you'll need to call the doPaint() function whenever you know this value could change. This is the "Live" functionality that you were talking about.
To do this, include a call like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Shift1Start_AfterUpdate()
  2.     Call doPaint
  3. End Sub
on the AfterUpdate event for all your TextBoxes as well as the OnCurrent Event of the Form.

Hope this gets you going.
Mar 13 '15 #10
@jforbes
Thanks a MILLION jforbes, going to get to work on this right away...

One quick question, where do I insert the initial code into?, The form's On Load?

Thanks Again!
Mar 13 '15 #11
jforbes
1,107 Expert 1GB
The doPaint Sub (or whatever you want to name it) shouldn't be in any event, just add it to the end of the Form's code. Then call it from the other events. I updated the code in Post#9 to include some of the other events to help clarify the structure and how the sub is called.
Mar 13 '15 #12
@jforbes
Okie dokie, got it working like champ, EXCEPT Lunch, the field gets totally ignored, I had formatting in it to force the user to use "00:00" but once I remove it, the totals don't make sense, on start 1:00 AM to 2:15 AM with a lunch of "1" the total is "-3:45" if I put "30" total comes out to "19:45"...
Mar 13 '15 #13
jforbes
1,107 Expert 1GB
Sounds like it's working. 1.25 hours - 4 hours = -3.75 hours.

Check out line 19. That's where Lunch is taken in consideration. You'll have to decide how you want to address that you are entering in four different shifts and then only one entry for Lunch. I put in a multiplier of four so that the one Field would apply to all four shifts. So, either three more Lunch TextBoxes need to be added, it's fine the way it is and maybe put a note on the Form letting the user know what is going on, or lastly, you could inspect each Shift and subtract a Lunch only if there is time entered against the shift.

Here is another version of the code where Lunch is only subtracted when a Shift has time against it.
Expand|Select|Wrap|Line Numbers
  1. Private Sub doPaint()
  2.  
  3.     Dim lTime As Long
  4.     Dim lTemp As Long
  5.     Dim lLunch As Long ' Long Lunch, Cracks me up
  6.  
  7.     ' Calculate Time in Minutes
  8.     lTime = 0
  9.     lLunch = (Nz([Lunch], 0) * 60)
  10.  
  11.     ' First Shift
  12.     lTemp = (Nz(DateDiff("n", Me![Shift1Start], Me![Shift1End]), 0))
  13.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  14.  
  15.     ' Second Shift
  16.     lTemp = (Nz(DateDiff("n", Me![Shift2Start], Me![Shift2End]), 0))
  17.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  18.  
  19.     ' Third Shift
  20.     lTemp = (Nz(DateDiff("n", Me![Shift3Start], Me![Shift3End]), 0))
  21.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  22.  
  23.     ' Fourth Shift
  24.     lTemp = (Nz(DateDiff("n", Me![Shift4Start], Me![Shift4End]), 0))
  25.     If lTemp <> 0 Then lTime = lTime + lTemp - lLunch
  26.  
  27.     ' Format and Display
  28.     Me.txtTotalHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  29.  
  30. End Sub
  31.  
One last thing, I used Round() instead of Fix() in the formatting portion. That was a mistake. Fix() is equivalent to truncating the value, which is what should be used in this case.
Mar 14 '15 #14
@jforbes
Hi jforbes,

Hope you had a pleasant weekend... Ok, getting back to work here, the lunch time doesn't have to come out of any particular shift, it should just be deducted from the total so that the totalhours field shows just the hours worked. So if the Lunch field is blank no time should be deducted, if no shifts are entered the total should be blank or zero...

Let me know what you think and if I should proceed to implement your code changes above...

Thanks Much!
Mar 16 '15 #15
@jforbes
Long Luch, haha, just saw that, hilarious...!

Ok, I changed the Round to Fix... Now not sure what the Lunch field's formatting should be set to. I have it set so that it allows only to add time in "00:00" format, so for 30 minutes I enter "00:30", but it only takes off 5 minutes... So if the start is 01:00 AM and end is 02:00 AM, the totalhours field shows "00:55"...
Mar 16 '15 #16
jforbes
1,107 Expert 1GB
The five minutes for Lunch makes sense. It's not right but makes sense. I was expecting the user to enter how many hours for Lunch into the Lunch Textbox, like .5 for a half hour. But if the Formatting for Short Time is used, a Half hour would have a value of 0.0208 since a 24:00 has a value of 1. So .0208 * 60 minutes, times 4 shifts would give 5 minutes instead of 120 minutes.

The formulas would need to be modified to address the value of Lunch that is not in hours but in a fraction of a day. We need a multiplier of 1440, from 60 minutes times 24 hours = 1.

I don't know what your code looks like at this point so if you want to post it, we can get it going. Or if your code looks like Post #10, then use something like this for line 19:
Expand|Select|Wrap|Line Numbers
  1.     lTime = lTime - ((Nz([Lunch], 0) * 1440) * 4) ' Times four for four Employees... maybe have four separate instances of Lunch?
  2.  
but hopefully, you are using code similar to post #14 as it addresses the lunch only if a shift is filled in. If so, then use something like the following for line 9:
Expand|Select|Wrap|Line Numbers
  1.     lLunch = (Nz([Lunch], 0) * 1440)
Tag, your it.
Mar 16 '15 #17
Ok, yeah using the code from post #10... I did not go the one on post #14 cause I thought you meant it should be used if we are giving lunch breaks at each shift, and that is not correct, just need it to deduct whatever time input on lunch field from the totalhours field...

I'll try what you just suggested and let you know what happens. Let me know if you think I should implement code on post #14 anyway regardless...

Thanks!
Mar 16 '15 #18
Ok, this is the code I'm using:

Expand|Select|Wrap|Line Numbers
  1. Private Sub doPaint()
  2.  
  3.     Dim lTime As Long
  4.  
  5.     ' Calculate Time in Minutes
  6.     lTime = 0
  7.     lTime = lTime + (Nz(DateDiff("n", Me![PPW1MondayRegularStart], Me![PPW1MondayRegularEnd]), 0))
  8.     lTime = lTime + (Nz(DateDiff("n", Me![PPW1MondayFlex1Start], Me![PPW1MondayFlex1End]), 0))
  9.     lTime = lTime + (Nz(DateDiff("n", Me![PPW1MondayCoreStart], Me![PPW1MondayCoreEnd]), 0))
  10.     lTime = lTime + (Nz(DateDiff("n", Me![PPW1MondayFlex2Start], Me![PPW1MondayFlex2End]), 0))
  11.     lTime = lTime - ((Nz([PPW1MondayLunch], 0) * 1440) * 4) ' Times four for four Employees... maybe have four seperate instances of Lunch?
  12.  
  13.     ' Format and Display
  14.     Me.txtPPW1MondayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  15.  
  16. End Sub
I set the input mask of the lunch field to "00:00;0;_" as per the default, then I set it to short time under format... With a time from 01:00 AM to 02:00 AM with a "00:30" lunch the PPW1MondayHours field displays "-1:00", if I enter "01:00" in lunch total displays "-3:00"
Mar 16 '15 #19
@alexrubio
I THINK I got it working now... I changed the:

Expand|Select|Wrap|Line Numbers
  1.     lTime = lTime - ((Nz([PPW1MondayLunch], 0) * 1440) * 4)
For this:

Expand|Select|Wrap|Line Numbers
  1.     lTime = lTime - ((Nz([PPW1MondayLunch], 0) * 1440) * 1)
The 1440*4 to 1440*1 and it seems to calculate it fine, the only thing that is bothering me is that it drops the leaving zero on lunch time so instead of looking like "00:30" it looks like "0:30", just looks weird... I think if we fix that, we might be good...

Then comes my pain staking process of getting the rest of the fields to work, Tuesday, Wednesday for PPW1 and then Monday-Friday for PPW2, but it should work just fine having worked out these kinks...

Thanks again jforbes, for your patience and GREAT help on this!
Mar 16 '15 #20
jforbes
1,107 Expert 1GB
That's good news. I'm not sure if there is anything that can be done about the formatting of Lunch. I looked into it a little, but I didn't see a formatting solution that would work. Let us know if you find one.

Typically, I would have the Lunch Field as a ComboBox with a list of values in minutes 10, 15, 20, 25... up to 2 hours for the user to select from. You could use this approach and create a ComboBox with two columns, the first a hidden key column with the available values and the second the formatted values like 00:10, 00:15, 00:20... up to 2:00. It's an option at least.
Mar 17 '15 #21
@jforbes
Thanks jforbes,

That is exacatly like I have the other fields set, with a combobox so they can choose the times... Do you think by doing it this way it will display it correctly?, Because it does allow you to enter the leading zero, it just drops it as soon as you leave the field though... The interesting thing is, it does not happen in the totalhours field... if its 3 hours it shows "03:00", so I figured there has to be a way to do it for the lunch field, I'll try the combo if not will look around a bit...

No to implement the rest of the days of PPW1, yesterday I tried to do it all together in the same doPaint module, but it disabled the Monday fields... I tried to create another Dim of tTime (as not to conflict with lTime), but it did not work... Do you think all of it should be together, or should I create a separate doPaint module for each day? Once complete with PPW1 (Pay Period Week 1) I have to do the same for PPW2 Monday - Friday...

THANKS!
Mar 17 '15 #22
jforbes
1,107 Expert 1GB
I think the ComboBox will give you greater control over what is displayed. Also, I think it will be easier to use for most of your users.

You should be able to do everything in one procedure and you should be able to reuse your variables. Calculate, Format and Display Monday, then reset lTime to Zero then Calculate, Format and Display Tuesday, then reset lTime to Zero and so on.

The only thing that concerns me now is:
Once complete with PPW1 (Pay Period Week 1) I have to do the same for PPW2 Monday - Friday...
I'm not sure how you are structuring your tables, but I would expect it to be broken down enough that you wouldn't have separate elements for your weeks and what has been done so far would work for all pay periods and not just for the first one. You might want to check out http://bytes.com/topic/access/insigh...ble-structures Just to make sure you aren't getting yourself into a mess.
Mar 17 '15 #23
@jforbes
So in other words you mean, do something like lTime = 0 then do everything for Monday, then another lTime = 0 then Tuesday, etc...?

On the table I have all fields in the format:

PPW1MondayRegularStart
PPW1MondayRegularEnd
PPW1MondayFlex1Start
PPW1MondayFlex1End
PPW1MondayCoreStart
PPW1MondayCoreEnd
PPW1MondayFlex2Start
PPW1MondayFlex2End
PPW1MondayLunch
PPW1MondayHours (UNBOUND)

All the way to Friday, then the same exact thing but with "PPW2" for the second week... The form looks like an excel spreadsheet with the 10 columns and 10 rows...
Mar 17 '15 #24
jforbes
1,107 Expert 1GB
You got it, reset lTime in between each day.

If you only have the two weeks at a time I think you will be OK. My concern was that you were going to have an endless amount of weeks that would need to be developed for.
Mar 17 '15 #25
Let ya know when I complete PPW2 and if I come across any issues...

Thanks again so much for your continued help...!!!
Mar 17 '15 #26
jforbes,

All is working like a champ, you have been wonderful in helping me with this and I'm extremely greatful, thanks a mill...

I have stumbled across another issue, I will create a new question for it as it has nothing to do with this one...

Thanks Again!!!
Mar 19 '15 #27
Hi jforbes,

Hope all is well with ya... I was hoping you could help me to add a calculation to the code you helped me work on a few weeks ago...

Here is a what it looks like:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub doPaint()
  3.  
  4.     Dim lTime As Long
  5.  
  6.     ' Calculate Time in Minutes - PPW1Monday
  7.     lTime = 0
  8.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayRegularStart], Me![cboPPW1MondayRegularEnd]), 0))
  9.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayFlex1Start], Me![cboPPW1MondayFlex1End]), 0))
  10.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayCoreStart], Me![cboPPW1MondayCoreEnd]), 0))
  11.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayFlex2Start], Me![cboPPW1MondayFlex2End]), 0))
  12.     lTime = lTime - ((Nz([cboPPW1MondayLunch], 0) * 1440) * 1)
  13.  
  14.     ' Format and Display - PPW1Monday
  15.     Me.txtPPW1MondayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  16.  
  17.     ' Calculate Time in Minutes - PPW1Tuesday
  18.     lTime = 0
  19.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayRegularStart], Me![cboPPW1TuesdayRegularEnd]), 0))
  20.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayFlex1Start], Me![cboPPW1TuesdayFlex1End]), 0))
  21.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayCoreStart], Me![cboPPW1TuesdayCoreEnd]), 0))
  22.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayFlex2Start], Me![cboPPW1TuesdayFlex2End]), 0))
  23.     lTime = lTime - ((Nz([cboPPW1TuesdayLunch], 0) * 1440) * 1)
  24.  
  25.     ' Format and Display - PPW1Tuesday
  26.     Me.txtPPW1TuesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  27.  
  28.     ' Calculate Time in Minutes - PPW1Wednesday
  29.     lTime = 0
  30.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayRegularStart], Me![cboPPW1WednesdayRegularEnd]), 0))
  31.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayFlex1Start], Me![cboPPW1WednesdayFlex1End]), 0))
  32.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayCoreStart], Me![cboPPW1WednesdayCoreEnd]), 0))
  33.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayFlex2Start], Me![cboPPW1WednesdayFlex2End]), 0))
  34.     lTime = lTime - ((Nz([cboPPW1WednesdayLunch], 0) * 1440) * 1)
  35.  
  36.     ' Format and Display - PPW1Wednesday
  37.     Me.txtPPW1WednesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  38.  
  39.     ' Calculate Time in Minutes - PPW1Thursday
  40.     lTime = 0
  41.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayRegularStart], Me![cboPPW1ThursdayRegularEnd]), 0))
  42.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayFlex1Start], Me![cboPPW1ThursdayFlex1End]), 0))
  43.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayCoreStart], Me![cboPPW1ThursdayCoreEnd]), 0))
  44.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayFlex2Start], Me![cboPPW1ThursdayFlex2End]), 0))
  45.     lTime = lTime - ((Nz([cboPPW1ThursdayLunch], 0) * 1440) * 1)
  46.  
  47.     ' Format and Display - PPW1Thursday
  48.     Me.txtPPW1ThursdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  49.  
  50.     ' Calculate Time in Minutes - PPW1Friday
  51.     lTime = 0
  52.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayRegularStart], Me![cboPPW1FridayRegularEnd]), 0))
  53.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayFlex1Start], Me![cboPPW1FridayFlex1End]), 0))
  54.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayCoreStart], Me![cboPPW1FridayCoreEnd]), 0))
  55.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayFlex2Start], Me![cboPPW1FridayFlex2End]), 0))
  56.     lTime = lTime - ((Nz([cboPPW1FridayLunch], 0) * 1440) * 1)
  57.  
  58.     ' Format and Display - PPW1Friday
  59.     Me.txtPPW1FridayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  60.  
  61.     ' Calculate Time in Minutes - PPW2Monday
  62.     lTime = 0
  63.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayRegularStart], Me![cboPPW2MondayRegularEnd]), 0))
  64.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayFlex1Start], Me![cboPPW2MondayFlex1End]), 0))
  65.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayCoreStart], Me![cboPPW2MondayCoreEnd]), 0))
  66.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayFlex2Start], Me![cboPPW2MondayFlex2End]), 0))
  67.     lTime = lTime - ((Nz([cboPPW2MondayLunch], 0) * 1440) * 1)
  68.  
  69.     ' Format and Display - PPW2Monday
  70.     Me.txtPPW2MondayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  71.  
  72.     ' Calculate Time in Minutes - PPW2Tuesday
  73.     lTime = 0
  74.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayRegularStart], Me![cboPPW2TuesdayRegularEnd]), 0))
  75.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayFlex1Start], Me![cboPPW2TuesdayFlex1End]), 0))
  76.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayCoreStart], Me![cboPPW2TuesdayCoreEnd]), 0))
  77.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayFlex2Start], Me![cboPPW2TuesdayFlex2End]), 0))
  78.     lTime = lTime - ((Nz([cboPPW2TuesdayLunch], 0) * 1440) * 1)
  79.  
  80.     ' Format and Display - PPW2Tuesday
  81.     Me.txtPPW2TuesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  82.  
  83.     ' Calculate Time in Minutes - PPW2Wednesday
  84.     lTime = 0
  85.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayRegularStart], Me![cboPPW2WednesdayRegularEnd]), 0))
  86.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayFlex1Start], Me![cboPPW2WednesdayFlex1End]), 0))
  87.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayCoreStart], Me![cboPPW2WednesdayCoreEnd]), 0))
  88.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayFlex2Start], Me![cboPPW2WednesdayFlex2End]), 0))
  89.     lTime = lTime - ((Nz([cboPPW2WednesdayLunch], 0) * 1440) * 1)
  90.  
  91.     ' Format and Display - PPW2Wednesday
  92.     Me.txtPPW2WednesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  93.  
  94.     ' Calculate Time in Minutes - PPW2Thursday
  95.     lTime = 0
  96.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayRegularStart], Me![cboPPW2ThursdayRegularEnd]), 0))
  97.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayFlex1Start], Me![cboPPW2ThursdayFlex1End]), 0))
  98.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayCoreStart], Me![cboPPW2ThursdayCoreEnd]), 0))
  99.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayFlex2Start], Me![cboPPW2ThursdayFlex2End]), 0))
  100.     lTime = lTime - ((Nz([cboPPW2ThursdayLunch], 0) * 1440) * 1)
  101.  
  102.     ' Format and Display - PPW2Thursday
  103.     Me.txtPPW2ThursdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  104.  
  105.     ' Calculate Time in Minutes - PPW2Friday
  106.     lTime = 0
  107.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayRegularStart], Me![cboPPW2FridayRegularEnd]), 0))
  108.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayFlex1Start], Me![cboPPW2FridayFlex1End]), 0))
  109.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayCoreStart], Me![cboPPW2FridayCoreEnd]), 0))
  110.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayFlex2Start], Me![cboPPW2FridayFlex2End]), 0))
  111.     lTime = lTime - ((Nz([cboPPW2FridayLunch], 0) * 1440) * 1)
  112.  
  113.     ' Format and Display - PPW2Friday
  114.     Me.txtPPW2FridayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  115.  
  116. End Sub
  117.  
Here is what I have to figure out, I have an unbound text field called txtTotalHours in which I need to display the total hours from PPW1Monday through PPW2Friday. I have tried to add this way:

Expand|Select|Wrap|Line Numbers
  1. Me.txtTotalHours = Me.txtPPW1MondayHours + Me.txtPPW1TuesdayHours + etc
But all it does is show the two hours side by side, like "04:1504:15"... Then all the daily total fields are wiped clean, in other words it screws up the above code... I have to undo to get it back to working status...

Thanks again for your kind help as always...

Alex
Apr 8 '15 #28
jforbes
1,107 Expert 1GB
Hey Alex,

I think the most straight forward way would be to create a variable to store off a running total into.

The easiest way to explain it would be in code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub doPaint()
  2.  
  3.     Dim lTime As Long
  4.     Dim lTotalHours As Long
  5.  
  6.     ' Calculate Time in Minutes - PPW1Monday
  7.     lTime = 0
  8.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayRegularStart], Me![cboPPW1MondayRegularEnd]), 0))
  9.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayFlex1Start], Me![cboPPW1MondayFlex1End]), 0))
  10.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayCoreStart], Me![cboPPW1MondayCoreEnd]), 0))
  11.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1MondayFlex2Start], Me![cboPPW1MondayFlex2End]), 0))
  12.     lTime = lTime - ((Nz([cboPPW1MondayLunch], 0) * 1440) * 1)
  13.     lTotalHours = lTotalHours + lTime
  14.  
  15.     ' Format and Display - PPW1Monday
  16.     Me.txtPPW1MondayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  17.  
  18.     ' Calculate Time in Minutes - PPW1Tuesday
  19.     lTime = 0
  20.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayRegularStart], Me![cboPPW1TuesdayRegularEnd]), 0))
  21.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayFlex1Start], Me![cboPPW1TuesdayFlex1End]), 0))
  22.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayCoreStart], Me![cboPPW1TuesdayCoreEnd]), 0))
  23.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1TuesdayFlex2Start], Me![cboPPW1TuesdayFlex2End]), 0))
  24.     lTime = lTime - ((Nz([cboPPW1TuesdayLunch], 0) * 1440) * 1)
  25.     lTotalHours = lTotalHours + lTime
  26.  
  27.     ' Format and Display - PPW1Tuesday
  28.     Me.txtPPW1TuesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  29.  
  30.     ' Calculate Time in Minutes - PPW1Wednesday
  31.     lTime = 0
  32.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayRegularStart], Me![cboPPW1WednesdayRegularEnd]), 0))
  33.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayFlex1Start], Me![cboPPW1WednesdayFlex1End]), 0))
  34.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayCoreStart], Me![cboPPW1WednesdayCoreEnd]), 0))
  35.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1WednesdayFlex2Start], Me![cboPPW1WednesdayFlex2End]), 0))
  36.     lTime = lTime - ((Nz([cboPPW1WednesdayLunch], 0) * 1440) * 1)
  37.     lTotalHours = lTotalHours + lTime
  38.  
  39.     ' Format and Display - PPW1Wednesday
  40.     Me.txtPPW1WednesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  41.  
  42.     ' Calculate Time in Minutes - PPW1Thursday
  43.     lTime = 0
  44.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayRegularStart], Me![cboPPW1ThursdayRegularEnd]), 0))
  45.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayFlex1Start], Me![cboPPW1ThursdayFlex1End]), 0))
  46.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayCoreStart], Me![cboPPW1ThursdayCoreEnd]), 0))
  47.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1ThursdayFlex2Start], Me![cboPPW1ThursdayFlex2End]), 0))
  48.     lTime = lTime - ((Nz([cboPPW1ThursdayLunch], 0) * 1440) * 1)
  49.     lTotalHours = lTotalHours + lTime
  50.  
  51.     ' Format and Display - PPW1Thursday
  52.     Me.txtPPW1ThursdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  53.  
  54.     ' Calculate Time in Minutes - PPW1Friday
  55.     lTime = 0
  56.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayRegularStart], Me![cboPPW1FridayRegularEnd]), 0))
  57.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayFlex1Start], Me![cboPPW1FridayFlex1End]), 0))
  58.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayCoreStart], Me![cboPPW1FridayCoreEnd]), 0))
  59.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW1FridayFlex2Start], Me![cboPPW1FridayFlex2End]), 0))
  60.     lTime = lTime - ((Nz([cboPPW1FridayLunch], 0) * 1440) * 1)
  61.     lTotalHours = lTotalHours + lTime
  62.  
  63.     ' Format and Display - PPW1Friday
  64.     Me.txtPPW1FridayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  65.  
  66.     ' Calculate Time in Minutes - PPW2Monday
  67.     lTime = 0
  68.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayRegularStart], Me![cboPPW2MondayRegularEnd]), 0))
  69.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayFlex1Start], Me![cboPPW2MondayFlex1End]), 0))
  70.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayCoreStart], Me![cboPPW2MondayCoreEnd]), 0))
  71.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2MondayFlex2Start], Me![cboPPW2MondayFlex2End]), 0))
  72.     lTime = lTime - ((Nz([cboPPW2MondayLunch], 0) * 1440) * 1)
  73.     lTotalHours = lTotalHours + lTime
  74.  
  75.     ' Format and Display - PPW2Monday
  76.     Me.txtPPW2MondayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  77.  
  78.     ' Calculate Time in Minutes - PPW2Tuesday
  79.     lTime = 0
  80.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayRegularStart], Me![cboPPW2TuesdayRegularEnd]), 0))
  81.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayFlex1Start], Me![cboPPW2TuesdayFlex1End]), 0))
  82.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayCoreStart], Me![cboPPW2TuesdayCoreEnd]), 0))
  83.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2TuesdayFlex2Start], Me![cboPPW2TuesdayFlex2End]), 0))
  84.     lTime = lTime - ((Nz([cboPPW2TuesdayLunch], 0) * 1440) * 1)
  85.     lTotalHours = lTotalHours + lTime
  86.  
  87.     ' Format and Display - PPW2Tuesday
  88.     Me.txtPPW2TuesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  89.  
  90.     ' Calculate Time in Minutes - PPW2Wednesday
  91.     lTime = 0
  92.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayRegularStart], Me![cboPPW2WednesdayRegularEnd]), 0))
  93.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayFlex1Start], Me![cboPPW2WednesdayFlex1End]), 0))
  94.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayCoreStart], Me![cboPPW2WednesdayCoreEnd]), 0))
  95.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2WednesdayFlex2Start], Me![cboPPW2WednesdayFlex2End]), 0))
  96.     lTime = lTime - ((Nz([cboPPW2WednesdayLunch], 0) * 1440) * 1)
  97.     lTotalHours = lTotalHours + lTime
  98.  
  99.     ' Format and Display - PPW2Wednesday
  100.     Me.txtPPW2WednesdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  101.  
  102.     ' Calculate Time in Minutes - PPW2Thursday
  103.     lTime = 0
  104.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayRegularStart], Me![cboPPW2ThursdayRegularEnd]), 0))
  105.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayFlex1Start], Me![cboPPW2ThursdayFlex1End]), 0))
  106.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayCoreStart], Me![cboPPW2ThursdayCoreEnd]), 0))
  107.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2ThursdayFlex2Start], Me![cboPPW2ThursdayFlex2End]), 0))
  108.     lTime = lTime - ((Nz([cboPPW2ThursdayLunch], 0) * 1440) * 1)
  109.     lTotalHours = lTotalHours + lTime
  110.  
  111.     ' Format and Display - PPW2Thursday
  112.     Me.txtPPW2ThursdayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  113.  
  114.     ' Calculate Time in Minutes - PPW2Friday
  115.     lTime = 0
  116.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayRegularStart], Me![cboPPW2FridayRegularEnd]), 0))
  117.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayFlex1Start], Me![cboPPW2FridayFlex1End]), 0))
  118.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayCoreStart], Me![cboPPW2FridayCoreEnd]), 0))
  119.     lTime = lTime + (Nz(DateDiff("n", Me![cboPPW2FridayFlex2Start], Me![cboPPW2FridayFlex2End]), 0))
  120.     lTime = lTime - ((Nz([cboPPW2FridayLunch], 0) * 1440) * 1)
  121.     lTotalHours = lTotalHours + lTime
  122.  
  123.     ' Format and Display - PPW2Friday
  124.     Me.txtPPW2FridayHours.Value = Right("00" & Fix(lTime / 60), 2) & ":" & Right("00" & lTime Mod 60, 2)
  125.  
  126.     ' Format and Display - Total Hours
  127.     Me.txtTotalHours = Right("00" & Fix(lTotalHours / 60), 2) & ":" & Right("00" & lTotalHours Mod 60, 2)
  128.  
  129. End Sub
  130.  
Apr 9 '15 #29
Hi jforbes,

Thanks much..., It seems to be partially working, when I enter info for one record and move on to the next, it carries the info into the other record. For example, I entered the following times on PPW1Monday Column of the first record:

Regular Start:
Regular End:
Flex1 Start: 09:30 AM
Flex 1 End: 10:00 AM
Core Start: 10:00 AM
Core End: 3:00 PM
Flex 2 Start: 3:00 PM
Flex 2 End: 7:00 PM
Lunch: 0:30
Total: 09:00 (txtPPW1MondayHours)

txtTotalHours field Shows 09:00 (so far so good)

When I move to the next record the txtPPW1MondayHours field shows "09:00" instead of "00:00" and the same with txtTotalHours field... If I fill in more days prior to moving to new record more time gets added to txtTotalHours and shown on the txtPPwXXXXXHours fields...

Remember that the txtPPwXXXXXHours fileds are unbound, all others are bound...

THANKS AGAIN!
Apr 9 '15 #30
jforbes
1,107 Expert 1GB
That is interesting.

I'm not 100% sure of what happens when you move to the next record. Are you moving to a different physical record in the database? Also, is the Form's DefaultView Property set to Single Form or Continuous Forms? Continuous Forms and Unbound Fields don't get along very well.

Also, I assumed that the Total Hours that you want to display is for the whole two weeks. Is this correct, or is there supposed to be a Total for each week?

My guess is either lTotalHours isn't getting reset at the right time or it's getting set from the from the Form after it has been created.

Last thing you could do is to repost what code you are using.
Apr 9 '15 #31
Ok, I'm using Single Form and this happens when I click the right arrow at the bottom of the record to go into a new record.

You are correct about the totals, I need a full total for the two weeks.

The code is the same as is on post #28, plus the changes you added on your post #29.

Let me know if you need additional info...
Apr 9 '15 #32
I think I finally found the culprit...! Don't understand why it would affect it that way, but for some reason it was...

The unbound field called txtTotalHours was once bound to TotalHours, before I inserted your code, I unbound it and changed its "Other" name to txtTotalHours, I had some other code to change font color and field lock status... I had forgotten to change that code to reflect the new name...

Here is that code:
Expand|Select|Wrap|Line Numbers
  1. Me.TotalHours.BackColor = vbRed
  2. Me.TotalHours.ForeColor = vbRed
  3. Me.TotalHours.Locked = True
When I changed the above to "txtTotalHours" it worked immediately...

SO once again, you are the main man and got it working as usual, thanks a mill!

Sorry for the confusion!!!
Apr 9 '15 #33

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dixie | last post by:
I have an Access 2000 form which has been running OK for a long time. Lately, it is playing up and doing things like causing Access to close suddenly when the form is opened or when saving the form...
2
by: TomislaW | last post by:
how can I calculate time needed for execution of my methods in asp.net app?
14
by: Kevin G. Anderson | last post by:
What: CAUG Meeting - QuickBooks IIF Files; Total Access Analyzer; CAUG Social When: Thursday, May 25, 2006, 6PM Who: Chris Monaghan and Kevin Anderson Where: The Information Management Group...
4
by: KPOJonesECC | last post by:
Hello, I am in the middle of an access database projet but are struggerling with a couple of things. I dont expect anyone to solve the problem for me, but would really appreciate a pointer in the...
1
by: burtell | last post by:
Previously, I wrote: I have designed an HTML form. The name of each element corresponds to a heading in an Access database on my computer. Is there a way for me to program the HTML form to send the...
4
by: pukhton | last post by:
Have a question about Access form. Total Dose (TextBox) Total Dose Unit (Combobox) (mg,mcg) Total Volume (TextBox) Final Dose (TextBox) Final concentration...
2
by: sammiesue | last post by:
Hi, I have form with 2 autosummed textboxes ("total" and "casinototal"). I would like to have a grand total textbox ("grandtotal") get its value from summing "total" and "casinototal", but it...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
0
by: ganeshvkl | last post by:
hi please,how Calculate time for loading data from Ms Access into Flex Grid anybody known reply soon
1
by: Tina Jones | last post by:
I am trying to calculate a total in a text box for a column on an Access form. There are 4 text boxes in this column (Material Hauled Amount, Haul Back Amount, Dentention Time Amount, and Stop Over...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.