Hi
When i run the above code i get Datatype mismatch error in second IF, Hope you could help me out to sort this problem?Code:Dim rec As StringDim but As String Dim Lid2 As String Dim sqlid As String Dim rst As Recordset Dim cdb As Database Lid2 = Me.Text0 'Job_No sqlid = "SELECT IsNull([Sale_Ended_Date]) FROM Repair WHERE Job_No = " & Lid2 If IsNull(Text0) Then MsgBox "Job No Cannot Be Empty !!!", vbInformation, "Job No required" Me.Text0.SetFocus ElseIf (sqlid) Then CurrentDb.Execute "Update Repair SET [Sale_Ended_Date] = '" & Format(Now()) & "' WHERE [Job_No]= " & Lid2 & " "