I'm pretty new to to Visual Studio and have hit a problem.I have a number of forms in an app, the parent form holds information about invoice queries. On the main form I have buttons that open another form showing further detail on the query. I need to pass 3 pieces of info (Query, Zdocref & Invoicenum) which are in a toolstrip, from the first form to the second and then have the second form show the relevant data. The forms are based on stored procedures which I know work, but I can only get 2 of the pieces of info to pass to the second form, below is the code for the 2 forms, any help would be appreciated as it's driving me mad. I know it's going to be something simple.
Parent form
Code:
Public Class frmQuery
Private Sub FillToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillToolStripButton.Click
Try
Me.GetAdjByQueryTableAdapter.Fill(Me.HP3000_HansonDataSet.GetAdjByQuery, QueryNumToolStripTextBox.Text, Me.CompanyNo)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub frmQuery_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ZDocRefTextBox.Visible = False
End Sub
Private Sub btnAuth_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAuth.Click
Dim frmAuth As New frmAjAuthInfo
frmAuth.Query = Me.QueryNumToolStripTextBox.Text
frmAuth.ZDocRef = Me.ZDocRefTextBox.Text
frmAuth.InvoiceNum = Me.InvoiceNumTextBox.Text
frmAuth.CompanyNo = Me.CompanyNo
frmAuth.QueryToolStripTextBox.Text = frmAuth.Query
frmAuth.TicketToolStripTextBox.Text = Me.ZDocRefTextBox.Text
frmAuth.Show(Me.CompanyNo)
End Sub
Private Sub btnTktInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTktInfo.Click
Dim frmTkt As New frmAjTktInfo
frmTkt.Query = Me.QueryNumToolStripTextBox.Text
frmTkt.ZDocRef = Me.ZDocRefTextBox.Text
frmTkt.InvoiceNum = Me.InvoiceNumTextBox.Text
frmTkt.CompanyNo = Me.CompanyNo
frmTkt.QueryToolStripTextBox.Text = frmTkt.Query
frmTkt.TicketToolStripTextBox.Text = Me.ZDocRefTextBox.Text
frmTkt.InvoiceNumToolStripTextBox.Text = Me.InvoiceNumTextBox.Text
frmTkt.Show(Me.CompanyNo)
End Sub
End Class
Child form
Code:
Public Class frmAjTktInfo
Private m_Query As String
Private m_ZDocRef As String
Private m_InvoiceNum As String
Public Property Query() As String
Get
Return m_Query
End Get
Set(ByVal value As String)
m_Query = value
End Set
End Property
Public Property ZDocRef() As String
Get
Return m_ZDocRef
End Get
Set(ByVal value As String)
m_ZDocRef = value
End Set
End Property
Public Property InvoiceNum() As String
Get
Return m_InvoiceNum
End Get
Set(ByVal value As String)
m_InvoiceNum = value
End Set
End Property
Private Sub FillToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Me.GetAjTktInfoTableAdapter.Fill(Me.HP3000_HansonDataSet.GetAjTktInfo, Me.CompanyNo, QueryToolStripTextBox.Text, TicketToolStripTextBox.Text, InvoiceNumToolStripTextBox.Text)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub frmAjTktInfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Me.GetAjTktInfoTableAdapter.Fill(Me.HP3000_HansonDataSet.GetAjTktInfo, Me.CompanyNo, Me.Query, Me.ZDocRef, Me.InvoiceNum)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub AjoAcnoLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
End Class