new to this form guys need some help
When opening a button and opening a new form as soon as it opens it close for some reason but its not giving any errors as to why its doing this
now i've checked the linked linking it to the next form thats fine but maybe someone could help me find a problem with this code ?
Private Sub PrintPerscription_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Login.con.Open()
sql = "SELECT Patient.* FROM Patient where Patient.Wardno = " & Login.WardNo.ToString
da = New OleDb.OleDbDataAdapter(sql, Login.con)
noOfRows = da.Fill(dsPatient, "Patient")
' add patients
For Me.count = 0 To noOfRows - 1
ComboBox1.Items.Add(dsPatient.Tables("Patient").Rows(count).Item(1))
Next
sql = "SELECT Drug.* From Drug "
da = New OleDb.OleDbDataAdapter(sql, Login.con)
result = da.Fill(dsDrug, "drug")
txtWardName.Text = Login.WardName
txtWardNo.Text = Login.WardNo
sql = "Select Prescriptions.* From Prescriptions"
da = New OleDb.OleDbDataAdapter(sql, Login.con)
result = da.Fill(dsPrescriptions, "Prescriptions")
Login.Close()
End Sub