The requirement is they can go to the first form any time in the operation. The problem here is only if the terminate the form1. if they close uisng the close button then there is no problem
Main Topics
Browse All Topicsi have two forms in my application the user starts with the form1 when he activates the form1 i get the connection with the following code in the UserForm_Activate
Set XREFClass = New XREFClass
With XREFClass
Set pConn = .GetDBConnect
End With
since the pConn is defined as public in form1 i use the form1.pConn in my second form also and populate the listview. Still now every thing works fine. the problem comes when the user goes back to the first form instead of closing the form using the close button where i hide the form1 he decides to terminate the form1 after that if i access form2 i get the error
"Requested operation requires and OLEDB session object, which is not supported by the current provider" because the connection is lost
How to solve this problem.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: VBClassicGuyPosted on 2009-09-11 at 10:41:57ID: 25311770
Can you just make the second form modal? When it's time to show the second form, just use:
Form2.Show 1
Then they HAVE to exit the second form to get back to the first form.
One warning, though, while the second form is up modally, you can't show any non-modal forms. In other words, any error dialogs or other forms Form2 shows have to be modal too.