Hello. For some reason I get a syntax error for the bold line below. Any one know why?
Private Sub cmdClockOut_Click()
Dim cn2 As New ADODB.Connection
Dim rs2 As New ADODB.Recordset
Dim EN As String
EN = lblEmployeeNumber.Caption
'Connect to database
cn2.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn2.ConnectionString = "Data Source='\Thorpe Park ICT6\TP.mdb';"
cn2.Open
rs2.Open "Select * from tbl_TimeSheet WHERE Employee_Number = '" & lblEmployeeNumber.Caption & "' AND Date = '" & Date & "'", cn2, adOpenDynamic
End Sub
Private Sub cmdClockOut_Click()
Dim cn2 As New ADODB.Connection
Dim rs2 As New ADODB.Recordset
Dim EN As String
EN = lblEmployeeNumber.Caption
'Connect to database
cn2.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn2.ConnectionString = "Data Source='\Thorpe Park ICT6\TP.mdb';"
cn2.Open
rs2.Open "Select * from tbl_TimeSheet WHERE Employee_Number = '" & lblEmployeeNumber.Caption & "' AND Date = '" & Date & "'", cn2, adOpenDynamic
End Sub