I am going brain dead. Can you please help? I have two update queries that need to run AfterUpdate on my form. The queries work great when I open them manually but I need to run them both on the "afterupdate" event on my subform. I also need the subform to requery to update the data on the form. So there is 3 actions 2 Update queries and Requery of subform named "Units Worked Billing Query subform". Below is what I tried but it isn't working at all:
Private Sub Hours_Worked_AfterUpdate()
On Error GoTo Err_Hours_Worked_AfterUpdate
Dim stDocName As String
stDocName = "Units Worked Query1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "Units Worked Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Forms![Units Worked Billing Query subform].Requery
Exit_Hours_Worked_AfterUpdate:
Exit Sub
Err_Hours_Worked_AfterUpdate:
MsgBox Err.Description
Resume Exit_Hours_Worked_AfterUpdate
End Sub
The second query depends on the results of the first one.
As you have probably guesssed, I don't know much about writing VB Code. Thanks again, Doug
Private Sub Hours_Worked_AfterUpdate()
On Error GoTo Err_Hours_Worked_AfterUpdate
Dim stDocName As String
stDocName = "Units Worked Query1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "Units Worked Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Forms![Units Worked Billing Query subform].Requery
Exit_Hours_Worked_AfterUpdate:
Exit Sub
Err_Hours_Worked_AfterUpdate:
MsgBox Err.Description
Resume Exit_Hours_Worked_AfterUpdate
End Sub
The second query depends on the results of the first one.
As you have probably guesssed, I don't know much about writing VB Code. Thanks again, Doug