is this coorrct if write like this:
Public Class Lecturer_Form
Private Sub Lecturer_Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As New System.Data.OleDb.OleDbConnection()
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\temp\Database1.accdb"
If conn.State = ConnectionState.Open Then conn.Close()
conn.Open()
Dim sql As String = "Select A.StaffNo,A.TimeIn,A.TimeOut, B.ProjectNo, C.AdminNo, C.UserName From tbl_lecturer A, tbl_assignment B, tbl_info C,= '" & TextBoxname.Text & "', '" & Textin.Text & "','" & Textout.Text & "'"
Dim sqlCom As New System.Data.OleDb.OleDbCommand(sql, conn)
sqlCom.Connection = conn
Dim sqlReader As System.Data.OleDb.OleDbDataReader = sqlCom.ExecuteReader()
If sqlReader.HasRows Then
While (sqlReader.Read)
ComboBoxstaff.Items.Add(sqlReader.Item("StaffNo").ToString)
ComboBoxpro.Items.Add(sqlReader.Item("ProjectNo").ToString)
ComboBoxadm.Items.Add(sqlReader.Item("AdminNo").ToString)
TextBoxname.Text = (sqlReader.Item("UserName").ToString)
Textin.Text = (sqlReader.Item("TimeIn").ToString)
Textout.Text = (sqlReader.Item("TimeOut").ToString)
LBtimeIN.Items.Add(sqlReader.Item("TimeIN").ToString)
LBtimeIN.Items.Add(sqlReader.Item("TimeOut").ToString)
End While
End If
End Sub
End Class