Hi everyone,
I have a main form (frmMaster) that opens and then opens a hidden form (frmCalculations)that holds a bunch of calculations. On frmMaster I have a command button that opens anther form (frmHourandSalary), which takes data from the main form, populates some fields on the newly opened frmHourlySalary and then performs a buch of calculations.
The Problem is that when the frmHourlySalary opens with the data, I must hit the F9 key to have the calculations update. I tried the DoCmd.Requery but it has no affect.
Is there a way to simulate the pressing of the F9 key with code?
Here is the code I have behind the main form button:
I have a main form (frmMaster) that opens and then opens a hidden form (frmCalculations)that holds a bunch of calculations. On frmMaster I have a command button that opens anther form (frmHourandSalary), which takes data from the main form, populates some fields on the newly opened frmHourlySalary and then performs a buch of calculations.
The Problem is that when the frmHourlySalary opens with the data, I must hit the F9 key to have the calculations update. I tried the DoCmd.Requery but it has no affect.
Is there a way to simulate the pressing of the F9 key with code?
Here is the code I have behind the main form button:
Code:
Private Sub cmdSalary_Click()
On Error GoTo Err_cmdSalary_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmHourandSalary"
stLinkCriteria = "[tblMaster.MasterID]=" & Me![txtMasterID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Requery
Exit_cmdSalary_Click:
Exit Sub
Err_cmdSalary_Click:
MsgBox Err.Description
Resume Exit_cmdSalary_Click
End Sub