soluga
Jan 4th, 2006, 05:17 AM
I have a solution with multiple projects, one project has a sql querie form in it, when the user builds up the query, I want to be able to pass the query back to the calling form, although I can access the sending form through reference I cannot access any controls on the form or any events, some code I have tried is below, grateful for any advice. Thanks
Public Class frmquerie
Inherits System.Windows.Forms.Form
Event GetSqlStatement()
blah blah
Private Sub btnexecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexecute.Click
RaiseEvent GetSqlStatement()
_GetSqlString = txtsqlstring.Text
MsgBox(getsqlstring.ToString)
End Class
On the other form
Public Class frmcolours
Inherits System.Windows.Forms.Form
Dim WithEvents _frmquerie As New common.frmquerie
Private Sub getthesql() Handles _frmquerie.GetSqlStatement
TextBox1.Text = _frmquerie.getsqlstring
End Sub
Public Class frmquerie
Inherits System.Windows.Forms.Form
Event GetSqlStatement()
blah blah
Private Sub btnexecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexecute.Click
RaiseEvent GetSqlStatement()
_GetSqlString = txtsqlstring.Text
MsgBox(getsqlstring.ToString)
End Class
On the other form
Public Class frmcolours
Inherits System.Windows.Forms.Form
Dim WithEvents _frmquerie As New common.frmquerie
Private Sub getthesql() Handles _frmquerie.GetSqlStatement
TextBox1.Text = _frmquerie.getsqlstring
End Sub