I am trying to search and update data on my table but this error appears:No value given for one or more required parameters error number:2147217904
Here is the coding for Search
Set Rcustomer = New Recordset
Rcustomer.Open "SELECT * FROM backups WHERE [Serial_Number]=" & Text1.Text, conn
Text1.Text = Rcustomer![Serial_Number]
Text2.Text = Rcustomer![Brand_Make]
Text3.Text = Rcustomer![Barcode]
Text4.Text = Rcustomer![PC_Location]
Text5.Text = Rcustomer![Customer_name]
Text6.Text = Rcustomer![CustomerTelNo]
Combo1.Text = Rcustomer![Company]
Combo2.Text = Rcustomer![Company_Location]
Combo3.Text = Rcustomer![Technician]
Text7.Text = Rcustomer![Reason]
Text8.Text = Rcustomer![Date_brought_back]
Text9.Text = Rcustomer![Date_out]
MsgBox "Record Found", vbInformation
And for Update:
Set cmdbutton = New ADODB.Command
sql = " Update backups set [Serial_Number]=" & "'" & Text1.Text & "'"
sql = sql & "," & " [Serial_Number]= ' " & Text1.Text & " ' "
sql = sql & "," & " [Brand_Make]=' " & Text2.Text & " ' "
sql = sql & "," & " [Barcode]=' " & Text3.Text & " ' "
sql = sql & " ," & " [Location]= ' " & Text4.Text & " ' "
sql = sql & "," & " [Customer_name]=' " & Text5.Text & " ' "
sql = sql & "," & " [CustomerTelno]=' " & Text6.Text & " ' "
sql = sql & "," & " [Company]=' " & Combo1.Text & " ' "
sql = sql & "," & " [Company_Location]= ' " & Combo2.Text & " ' "
sql = sql & "," & " [Technician]=' " & Combo3.Text & " ' "
sql = sql & "," & " [Reason]=' " & Text7.Text & " ' "
sql = sql & "," & " [Date_brought_back]=' " & Text8.Text & " ' "
sql = sql & "," & " [Date_out]=' " & Text9.Text & " ' "
sql = sql & " where [Serial_Number]=" & Text1.Text
With cmdbutton
.ActiveConnection = cn
.CommandText = sql
.Execute
End With
MsgBox "Record Successfully Updated", vbInformation
Exit Sub
My fields are all text from the table there is no number
Please help me
Thanks