Closing a form from another form

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Sorry forgot first line of code:

Dim stDocName As String

stDocName = "[Form].[Pop-up Update Allocations1]"
DoCmd.Close stDocName
 
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
 
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
can't find form 4
write conflicts 1
Write Conflict 6
Stop Macro On Close Event 1
How would i refer to a closed report? 8
execute code after pop-up form closes 2
Close and Return to Form 2

Back
Top