good day guys.. can you help me how to call a function from form1 to form2?
here is my code.. and its error..
*** FORM1 ***
[code]
Public Sub SQLConn()
connection = New SqlConnection("Data Source=PC-PC\SQLEXPRESS;Initial Catalog=health center;User ID=sa;Password=pwd")
End Sub
[code]
( then i want to call the code and use it in form2 )
*** FORM2 ***
[code]
Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
call FORM1.SQLConn()
[code]
here is my code.. and its error..
*** FORM1 ***
[code]
Public Sub SQLConn()
connection = New SqlConnection("Data Source=PC-PC\SQLEXPRESS;Initial Catalog=health center;User ID=sa;Password=pwd")
End Sub
[code]
( then i want to call the code and use it in form2 )
*** FORM2 ***
[code]
Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
call FORM1.SQLConn()
[code]