Hi I have the code below, I'm trying to check first if the textboxes have values then insert values into database but I get debug error,
please help.
If txtSalary.Text <> " " & txtmCover <> " " & txtMember.Text <> " " & txtmRate.Text <> " " Then
tsql = "INSERT INTO Hpacc4(SalaryBill,Rate,RateType,Membership,Cover) " & _
"VALUES(" & Trim(txtSalary.Text) & "," & Trim(txtmCover) & ", " & Trim(txtMember.Text) & ", " & Trim(txtmRate.Text) & ")" & _
"WHERE Scheme = '99993' AND RunMonth = '200604' AND AccCode = '110'"
Else
MsgBox "Enter Values"
End If
please help.
If txtSalary.Text <> " " & txtmCover <> " " & txtMember.Text <> " " & txtmRate.Text <> " " Then
tsql = "INSERT INTO Hpacc4(SalaryBill,Rate,RateType,Membership,Cover) " & _
"VALUES(" & Trim(txtSalary.Text) & "," & Trim(txtmCover) & ", " & Trim(txtMember.Text) & ", " & Trim(txtmRate.Text) & ")" & _
"WHERE Scheme = '99993' AND RunMonth = '200604' AND AccCode = '110'"
Else
MsgBox "Enter Values"
End If