Help in forms and tables

flmngldn

New member
Local time
Today, 11:18
Joined
Feb 26, 2005
Messages
5
I am new at this. I have a database table emp with a check box for "Exempt" employees. I have a form "Enter time card" that is a data entry and would like to automatically populate the overtime field with the value of regtime*1.5 if the check box is ticked. I am having trouble doing this. Please help!! :confused:
 
f,

Need more specifics.

Daily entry - Use the AfterUpdate event of regtime:

Code:
If Me.CheckBoxOvertime And Me.regtime > 8 Then
   Me.regtime = 8
   Me.Overtime = (Me.regtime - 8) * 1.5
End If

Wayne
 
can you not do an IF command that looks at the field for the tick box, and if it is ticked then the value is 1.5.

not too sure of the exact command but
=IIf(tickbox]="1","1.5","")

This is in theory what needs to be done - It should work. - Probably


If tickbox was labled tick
then
=IIf([tick]="1","1.5","")
another sample
=IIf([FTurnover]>149999,"High Growth","")

Now if you want to do something else i.e muliliply it then..
Create a Text Box.
in the Text box write the following
=IIf([tick]="1",[overtime]*"1.5","")

The above is not correct, but I am sure someone can correct by IIF., not really very good at including other fileds in IIF (never tried it but in theory this should do what you need)


Hope this helps
 
Last edited:
More specifics

I have a table that contains 'Employee Name', 'Employee Department', 'Exempt' tickbox, 'Regularpay' and 'Overtimepay'. What I need to setup is if the 'Exempt' is ticked then calculate the 'Overtimepay' by 'Regularpay'*1.5
 
I did the IIf and got the results to show on the form. That is great. Now I need to save the data to the field in the table. As it stands I can view the results but it is not stored. How do I store the value in the table?
 

Users who are viewing this thread

Back
Top Bottom