Solved After update

dullster

Member
Local time
Yesterday, 21:44
Joined
Mar 10, 2025
Messages
74
I have a Main form with 2 subforms. The main form contains records from the Table “Employees”, showing “Hourly Rate, “Hours per Pay Period” and “Total of paycheck”. I have added a Text Box that calculates Overtime owed if there is any.

Subform 1 shows the calculation of the Taxes owed from the field “Total of paycheck” on the main form.

Subform 2 is to manually enter the calculated field into the Transaction Table

After calculating the regular hours, plus overtime hours, I want to enter that calculated amount to “Total of paycheck” on the main form and recalculate the Taxes owed in Subform 1.

I have the AfterUpdate set to

Private Sub Total_of_pay_Check_AfterUpdate()
Form"frmpayrollrecommsub"Requery
End Sub

I'm getting Syntax Error. I've tried several different arguments and it's not working.
 
I have a Main form with 2 subforms. The main form contains records from the Table “Employees”, showing “Hourly Rate, “Hours per Pay Period” and “Total of paycheck”. I have added a Text Box that calculates Overtime owed if there is any.

Subform 1 shows the calculation of the Taxes owed from the field “Total of paycheck” on the main form.

Subform 2 is to manually enter the calculated field into the Transaction Table

After calculating the regular hours, plus overtime hours, I want to enter that calculated amount to “Total of paycheck” on the main form and recalculate the Taxes owed in Subform 1.

I have the AfterUpdate set to

Private Sub Total_of_pay_Check_AfterUpdate()
Form"frmpayrollrecommsub"Requery
End Sub

I'm getting Syntax Error. I've tried several different arguments and it's not working.
I tried

Private Sub Total_of_pay_Check_AfterUpdate()
Me.frmpayrollrecommsub.Form.Requery
End Sub

I'm getting
Compile error, Method or data member not found
 
When you typed "Me.", was the form in the Intellisense list? Then it should compile.
Decompile the app and see if that helps.
 
I tried

Private Sub Total_of_pay_Check_AfterUpdate()
Me.frmpayrollrecommsub.Form.Requery
End Sub

I'm getting
Compile error, Method or data member not found
I tried this
Private Sub Total_of_pay_Check_AfterUpdate()
Me.Requery
End Sub

It does a requery of the frmpayrollrecommsub but then exists to the first employee and starts a new record.
 
I tried this
Private Sub Total_of_pay_Check_AfterUpdate()
Me.Requery
End Sub

It does a requery of the frmpayrollrecommsub but then exists to the first employee and starts a new record.
I think I finally succeeded. I tried this

Private Sub Total_of_pay_Check_AfterUpdate()
Forms![FrmPayroll]![frmCDpayrollrecommsub].Requery
End Sub

AND created a update Salary button to update the Employee table. Then it worked.
 
Requery the recordset of the form and not the form itself, if you do not want the record pointer to move.
 

Users who are viewing this thread

Back
Top Bottom