Hi, I'm new to visual studio...(yes i'm a newbee) I've got 2 Forms(Form1,Form2) Form1 have an OleDBDataadapter to my database and linkek via a dataset to a dbgrid... I want after a dbl click event on 1 row of the form1.dbgrid to open form2 as a detail form of the current row... My 2 forms are set but i can't open form2 on the selected item of the form1...form2 always open itself at the first record of the database What's the best solution?? bookmark? passing a paramater form to form??? I need Help!!! Thanx
I do this by creating a dataset of the current row and passing it to the dataset of the second form and then when closeing form2 I merge the datasets back together.
If IsDBNull(CurrentTrackingNumber) = True Then MsgBox("No Tracking Number Selected") Else Dim checkFrm As Form, Opened As Boolean For Each checkFrm In Me.MdiChildren If InStr(checkFrm.Text, CurrentTrackingNumber) Then checkFrm.Focus() Opened = True End If Next If Opened = False Then TicketLoadSetting = 0 Dim frm As New TroubleReport() frm.MdiParent = Me Dim RowDS As DataSet = Me.objTroubleReports.Clone() Dim copyRows() As DataRow = objTroubleReports.Tables("tblTroubleReports").Select("TrackingNumber = " & CurrentTrackingNumber) Dim custTable As DataTable = RowDS.Tables("tblTroubleReports") Dim copyRow As DataRow For Each copyRow In copyRows custTable.ImportRow(copyRow) Next frm.objSelectedTroubleReport.Merge(RowDS, False) frm.Show() End If End If Me.Cursor = Windows.Forms.Cursors.Default()
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.