Closing a form from another form

G

Guest

I have a form "Pop-up Update Revenue1" that provides input for a filter for
another form "Update Revenue Budget Allocations2". Once "Update Revenue
Budget Allocations2" closes, I want to also close "Pop-up Update Revenue1". I
used the following code to attempt the closure of this form. Needless to say
it does not work.

Private Sub Form_Close()

stDocName = "[Form].[Pop-up Update Allocations1]"
DoCmd.Close stDocName

End Sub

How can I close an open form when I close "Update Revenue Budget
Allocations2"?


Thanks,

Dennis
 
G

Guest

Sorry forgot first line of code:

Dim stDocName As String

stDocName = "[Form].[Pop-up Update Allocations1]"
DoCmd.Close stDocName
 
F

fredg

Sorry forgot first line of code:

Dim stDocName As String

stDocName = "[Form].[Pop-up Update Allocations1]"
DoCmd.Close stDocName

The name of the form is "Pop-up Update Allocations1"
NOT
"[Form].[Pop-up Update Allocations1]"

And when you close an object, the first argument of the Close method
is the type of object.

Dim stDocName As String
stDocName = "Pop-up Update Allocations1"
DoCmd.Close acForm, stDocName
 
G

Guest

Fredg,

That fixed it!
--
Thanks,

Dennis


fredg said:
Sorry forgot first line of code:

Dim stDocName As String

stDocName = "[Form].[Pop-up Update Allocations1]"
DoCmd.Close stDocName

The name of the form is "Pop-up Update Allocations1"
NOT
"[Form].[Pop-up Update Allocations1]"

And when you close an object, the first argument of the Close method
is the type of object.

Dim stDocName As String
stDocName = "Pop-up Update Allocations1"
DoCmd.Close acForm, stDocName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Link Criteria again 2
write conflicts 1
can't find form 4
Link Criteria 1
Print form before closing... 1
Skip Event Procedure if form is null 3
Cancel a Report from a form 7
Stop Macro On Close Event 1

Top