Calculating time into cash value

I tried that one earlier and it came back #Name? also. However, multiplying it by 1440 has solved that bit of the problem - I now have a text box displaying the number of minutes (so for 04:20 it correctly shows 260 mins; my problem now is how to show that as 4hrs in one textbox, and 20mins in another.
 
Okay do you have the original time available in HH:MM - if so use Datepart; by far the easiest.

If not and you have the total minutes then the hours will be Int(TotMins / 60)
and the minutes will be (TotMins - (60 * (Int(TotMins / 60)) - In English that means the The total minutes - the number of minutes in the whole hours
 
Yes, I have the original HH:MM in the control txtSatOTTotalHrs, and I also have the total minutes in another unbound textbox.

I shall have a search for DatePart.

One other question - when creating a report to export in Excel, is it a case of simply designing the report as normal and then select excel as the format in the vba for the control that opens/exports the report?

Cheers
 
Depending on what you need in the report, is it to look pretty or is it data to use tied in with another spreadsheet?
If it just needs to look good , try formatting in an access report and export to PDF. Maybe draw out what you need first...
 
It needs to look semi-pretty, but has to be an excel spreadsheet - the hope is that it can be used to replace an existing spreadsheet that gets sent off for external processing. Maybe I should take a wee wander into the reports section?
 
Okay do you have the original time available in HH:MM - if so use Datepart; by far the easiest.

If not and you have the total minutes then the hours will be Int(TotMins / 60)
and the minutes will be (TotMins - (60 * (Int(TotMins / 60)) - In English that means the The total minutes - the number of minutes in the whole hours


Just to update this - I have now tried DatePart as suggested, and it does exactly what I need. Thank you for your patience and help :)
 

Users who are viewing this thread

Back
Top Bottom