troubleshooting Question

Change WindowMode from acHidden to acDialog after opening it

Avatar of PeterRollinson
PeterRollinson asked on
Microsoft Access
10 Comments1 Solution2359 ViewsLast Modified:
I need to open a form as follows:
    stDocName = "PostCodeSearch"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog
Make some change as follows:
    Forms.PostCodeSearch.PCArea = strSelectedText
    Forms.PostCodeSearch.Town = ""
    Forms.PostCodeSearch.Street.SetFocus

Then change its WindowsMode to acDialog so that the code in the calling module waits for the form 'PostCodeSearch' to close as if I had originally opened it acDialog.

Code being used
------------------------------------------------------------
Private Sub PCCearch_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PostCodeSearch"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acHidden
If Nz(strSelectedText, "") <> "" Then  
    Forms.PostCodeSearch.PCArea = strSelectedText
    Forms.PostCodeSearch.Town = ""
    Forms.PostCodeSearch.Street.SetFocus
End If
Forms.PostCodeSearch.Visible = True
'Wait here for the 'PostCodeSearch' form to close and return control here
End Sub


Thanks
ASKER CERTIFIED SOLUTION
Leigh Purvis
Database Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros