Closing a form

melodyF

Registered User.
Local time
Today, 20:13
Joined
Mar 20, 2002
Messages
19
I have a form I want to close when I open another. In the form I want to close I have an ID number that is being passed to a filter query that is used in the form that should open.

I have tried alot of things that don't seem to work. I know when you close a form, the code basically stops. That seems to be what is happening. I have tried various combination of code:



Dim strFormName As String
strFormName = "frmCallSearch"
DoCmd.Close acForm, strFormName


Docmd.Openform"frmSeachResults"
 
Try The Code below:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmSeachResults"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmCallSearch"

Hope This Helps...

Don
 
Dont close the form, hide it
Me.Visible = False
If you close it you cant (as you have seen) refer to it to pass an OpenArgs variable.
 
And there's one other option. In the code to close the other form, save the information you want in a Static variable within a module. Then you have the info that won't change until you close the database or update it.

I use that option occasionally depending on the situation.
 

Users who are viewing this thread

Back
Top Bottom