Openform Is Closing Form

abenitez77

Registered User.
Local time
Today, 12:53
Joined
Apr 29, 2010
Messages
141
I currently have 3 forms open and when I call a specific function and it gets to this line below it goes to the on close of 1 of my open forms closes that form before it opens the selected form in code (below) in design mode. It doesn't close all my forms....why does it do this?

DoCmd.OpenForm formname:=dynform, View:=acDesign, WindowMode:=acHidden
 
I bet you have code that closes that form, either triggered in dynform or in the code you haven't shown
 
Here's a few lines before and a few lines after...but i have stepped thru it and it goes to the "on close" of my already open form as soon as it starts to executes the DoCmd.openform line. When it is is done closing my other form it steps to the next line Set MyFrm....

Select Case Me.lstReportName.Column(5)

Case "Project"

If (DLookup("ProjectName", "Projects", "ProjectsId=" & Me.lstReportName.Column(4)) = "System") Then
dynform = OpenReport
Else
dynform = "Dyn_" & Trim(STR(Proj_ID)) & "_" & OpenReport
End If

' Open the Subform in design mode
DoCmd.OpenForm formname:=dynform, View:=acDesign, WindowMode:=acHidden

Set MyFrm = Forms(dynform).Form
 
There is not enough here for a remote diagnosis. Winnow your code down to the bare remains required to illustrate the problem and post a copy of the db here with instructions how to recrete the issue
 
need to step out...will try to post a bare minimal app and replicate the issue when i get back.
 
Tried stripping it down and recreating the issue but it does not happen.
 

Users who are viewing this thread

Back
Top Bottom