Click here to Skip to main content
15,896,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two forms frm1.vb and frm2.vb in windows application. frm2.vb has a method OpenDetail(detailID). The purpose of OpenDetail is to load the records from database based on detailID and display in frm2. detailID can be passed from frm1.vb as well. When I pass detailID from frm1.vb, value is being passed to frm2.vb but frm2.vb is still displaying the old records based on detailID that was passed from frm2.vb.detailID passed from frm1.vb is not being displayed. My code for passing value from frm1.vb to frm2.vb is like this:

frm1.vb code to pass value to frm2.vb:::

 Dim detailInstance As New frm2()
detailInstance.OpenDetail(detailID) 

frm2.vb code:
Public Sub OpenDetail(detailID as Integer=0) 
'do something 
End Sub



When calling from frm1.vd and passing detailID to frm2.vb, value is being passed but page is rendering old result.

Any help??
Thanks in advance

What I have tried:

I have tried setting the values in frm2 constructor  from frm1 but it is not working.
Posted
Updated 12-Apr-17 20:53pm
v3
Comments
Richard MacCutchan 13-Apr-17 4:25am    
Not enough of your code here to begin to guess what is happening.
Member 12286211 22-Feb-19 14:16pm    
Try put your method in form2closing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900