473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Close Form Problem

Hi

I close a form in the DoubleClick event of a list view in one form and the
form that opened this form closes as well the only way I can aoid it is by
making the form not Modal

Thank you
Shmuel
Nov 21 '05 #1
2 1000
Can you post some of the code that opens the Form where the ListView lives
and the code that closes the form?
"S Shulman" <sm*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi

I close a form in the DoubleClick event of a list view in one form and the
form that opened this form closes as well the only way I can aoid it is by
making the form not Modal

Thank you
Shmuel

Nov 21 '05 #2
Mike,

View code below

Cheers,
Shmuel
This code opens the form

Private Sub btnSelectClient_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSelectClient.Click

Dim iClientID As Integer

'Create the client search form

Dim frm As New frmSearchClient(frmSearchClient.e_FormMode.eShowLi st)

frm.StartPosition = FormStartPosition.CenterScreen

frm.ShowDialog()

'Get the ID of the selected client

iClientID = frm.iClientSelectedID

'If selected

If iClientID > 0 Then

eRelType = modEnum.e_RelType.Client

iRelID = iClientID

AddRef()

Else

Exit Sub

End If

End Sub
And this code closes the form
Private Sub LV_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LV.DoubleClick

iClientSelectedID = LV.SelectedItems(0).Tag

Close()

End Sub


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rick Collard | last post by:
I can consistently crash Access 2002 SP2 using a /runtime switch on an mdb that has the Compact on Close property set after opening and closing a form that uses the References collection. Remove...
2
by: chanchito_cojones | last post by:
hi there, I am needing some help with a database I am putting together. The database works off of a main Form, which then has buttons on it that will open up other forms. The problem I am having...
1
by: Martin Douglas | last post by:
Hey guys, maybe someone can help me with some MDI issues I have. A co-worker asked me a very simple question, one that I blew off as trivial, and it has become a time-consuming issue. Simply...
6
by: Ashish | last post by:
It might be basics for many but I never gave attention on this before. Steps: Add 2 forms (Form1/Form2) in application. Create a object in Form1 for Form2. Form2 f2 = new Form2(); //line...
7
by: Alice | last post by:
Hi, In my program, the user can navigate to many different forms. When they go to the next form, I want the form they have left to close. However, the forms aren't closing. Can anyone tell me...
19
by: Nathan | last post by:
I know this has been asked previously, but I've run into a situation where I need to know the difference between close and dispose, and I can't get the information I need from msdn help or previous...
4
by: erick-flores | last post by:
Hello I am using an If statement to test if a field = IsNull then close that form and open another one. Here is the code: Private Sub Form_Load() If IsNull(Me.loc_fk) Then MsgBox "This...
4
by: Jason Huang | last post by:
Hi, In my C# windows form project, how do I in a formA open another formB, and close formA when formB is opened? Thanks for help. Jason
3
by: rajashekar4dotnet | last post by:
how to open one form from the other form and close the first form if there are only two forms in windows application(VB.net) i had tried this method dim f as new form2 form2.show( )...
7
by: Sin Jeong-hun | last post by:
I have a dialog form which pops up from the main window using the ShowDialog() method. this dialog has no or button, and it has quite a lot of controls on it. Now, I want to close this dialog...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.