B
Bonnie A
Hi everyone! Using A02 on XP. I have a HUGE form that works best in 14
sections. On my main form I have a button to open the first form. To run
them in sequence, each form has a Next button to open the forms in a certain
order. However, when I'm done I have a stack of 15 forms open (Main form
plus the 14 sections). What is the best way to close them? All at once from
the 14th segment or as I move from form to form? I put a DoCmd.Close in the
code that opens the next form but get an error message "The expression you
entered referrs to an object that is closed or doesn't exist." Here is my
code. (I get the error after I insert the DoCmd.Close, the rest of it works
fine before the insertion.)
Private Sub Next_Click()
On Error GoTo Err_Next_Click
DoCmd.Close 'I INSERTED THIS LINE
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fPlanAuditSub02SPY"
stLinkCriteria = "[AuditID]=" & Me![AuditID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Next_Click:
Exit Sub
Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click
End Sub
On the form above, I want to be able to open fPlanAuditSub02SPY and close
fPlanAuditSub01Census.
Looking for advice on how best to do this. Thanks in advance for any help.
sections. On my main form I have a button to open the first form. To run
them in sequence, each form has a Next button to open the forms in a certain
order. However, when I'm done I have a stack of 15 forms open (Main form
plus the 14 sections). What is the best way to close them? All at once from
the 14th segment or as I move from form to form? I put a DoCmd.Close in the
code that opens the next form but get an error message "The expression you
entered referrs to an object that is closed or doesn't exist." Here is my
code. (I get the error after I insert the DoCmd.Close, the rest of it works
fine before the insertion.)
Private Sub Next_Click()
On Error GoTo Err_Next_Click
DoCmd.Close 'I INSERTED THIS LINE
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fPlanAuditSub02SPY"
stLinkCriteria = "[AuditID]=" & Me![AuditID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Next_Click:
Exit Sub
Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click
End Sub
On the form above, I want to be able to open fPlanAuditSub02SPY and close
fPlanAuditSub01Census.
Looking for advice on how best to do this. Thanks in advance for any help.