Calculating labour time, incl. VAT, excl. VAT and VAT amount

because the time is REALLY held in days, however you display it, so to change it into hours you have to multiply the answer by 24.

i recall now in my test, i set

total (now as a fixed number) = (nz(time1,0)+nz(time2,0)+nz(time3,0)) * 24
 
gemma-the-husky said:
because the time is REALLY held in days, however you display it, so to change it into hours you have to multiply the answer by 24.

i recall now in my test, i set

total (now as a fixed number) = (nz(time1,0)+nz(time2,0)+nz(time3,0)) * 24
Hehe, when I woke up I saw it immediately.... :) stupid... :o

Thanks a lot once again!
 
yes, its interesting how flexible access is, at handling time and date values. There's another thread describing a date of 40-April-06, which Access decides should represent 6th April 1940, instead of determining the date is not valid.
 
So sometimes Access doesn't understand itself huh? It's a bit like me then ;)

How about this one:

If Me.TimeCaseCreation.Value = Null Then Me.TimeCaseCreation.Value = Time()
If Me.TimeCaseCreation.Value <> Null Then Exit Sub
Doesn't come up with a time in the field, so I'm guessing by using the syntax I'm using, I'm making a mistake and I should probably Nz it? I've tried some different things, but none of them makes sense.

What needs to be done, is when a case is created the current system time and in another field current system date should be displayed. If the case already exists the time should not get overwritten.

I'm still trying to solve it myself but have come up empty untill now.
 
hmmzzz... just putting Me.TimeCaseCreation.Value = Time () in the code, doesn't come up with anything either and I could have sworn it did just a couple of hours ago....

Edit: strange....

In the on_load event of the form:

Me.TimeCaseCreation.Value = Nz(Time, 0) doesn't fill in the field.

If I close the form and open it again then there is a time in the field, not the time of creation but the current time. So why doesn't it assign a value the first time 'round?
 
Last edited:
not sure where you are putting these things

consensus is you cant use null as in ... if expn = null

you have to say if isnull(expn)

so
If isnull(timeCaseCreation) Then Me.TimeCaseCreation.Value = Time()

but this doesn't allow for timecasecreation actually being zero

this is where nz is useful because

If nz(timeCaseCreation,0)=0 Then Me.TimeCaseCreation.Value = Time()

covers both the null and ther zero values.

----------------------------------------------

on load probably won't work, because the fields aren't populated the first time until the on currect event.

-----------------------------------------------
i've found sometimes . works and sometimes it doesn't. I think dot (. ) works if it refers to a field in the source query. bang (!) works by referring to a field on the form. Often they are the same, but perhaps you have changed something in the last couple of hours.
 
At a certain moment, I figured out the Nz for this one, but it didn't seem to work. Now, in the on current event it does work. Very good. :)

This took me hours..... whahahaha.... it's sad really ;)
But I'm starting to get the hang of the Nz thingie. I'm going to do that for a lot of other fields too.
 
I'm sorry, but what do you mean by . (dot)? In what context?
 

Users who are viewing this thread

Back
Top Bottom