PDA

View Full Version : Solved: Maximum Totals



mattster1010
10-07-2008, 07:58 AM
Afternoon All,

I have designed a timesheet application within MS access and I have a textbox called 'weekly hours' that accumilates the total hours worked by an employee over a weekly basis and a textbox that is called 'banked hours'.

I want the 'banked hours' textbox to be populated with hours from the weekly hour textbox when the weekly hour text box totals hits 36 hours, any hours over 36 will need to be populated in the banked hours textbox.

Can anyone let me know how I would get this going?

Cheers,

Mattster

CreganTur
10-07-2008, 08:01 AM
Well, using VBA you could do something like:

If Me.TotalHours > 36 Then
Me.BankedHours = Me.TotalHours - 36
End If

You just have to make certain your textbox's value is set to the correct number data type. If it's not, and you get a Type Mismatch error, then you can use a Type Conversion function to force it into a number data type so you can run the calculation.

Search Access Help for Type Conversion for more info on using them.