troubleshooting Question

showing forms

Avatar of bearpaws
bearpaws asked on
Visual Basic.NET
10 Comments1 Solution253 ViewsLast Modified:
Hi folks,

 I have a two forms, a selection form and a display form. On the selction, the user can select a value from a listbox. Once the user selects a value, I pass the value to the dispaly form. Not a problem and the value passed is the correct one showing.

But whne I try to close the selection form, it craps out. I don't understand what is wrong with this coding:

vrecid = lstContacts.SelectedValue
frmBrowseContacts.lblContactId.Text = vrecid
Me.Close()
frmBrowseContacts.WindowState = FormWindowState.Normal
frmBrowseContacts.Show()
frmBrowseContacts.Focus()

If I take the me.close out (I wnat the selection form to close), it works. If I put the me.close in, it errors out about the lisbox being disposed...
any help appericated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
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