1
Answer

No value given for one or more required parameter for update query

Photo of ZULFAHMI AIDI

ZULFAHMI AIDI

15y
5.5k
1
Hi there, i got problem here when i try to run the update query. the msg box the error is "No value given for one or more required parameter for update query".

the query is
Dim strSQL As String = ("UPDATE [DailyReport] SET [Status] ='" & txtRepSta.Text & "' WHERE DailyID ='" & txtDailyRep.Text & "'  ")
                Dim cmd As OleDbCommand = New OleDbCommand(strSQL, OleDbConnection)
                Dim objread As OleDbDataReader
                objread = cmd.ExecuteReader
                MsgBox("Update Success")

i have try to add more paremeter but the result still the same, "No value given for one or more required parameter for update query". There new query i try
 Dim strSQL As String = ("UPDATE [DailyReport] SET [Status] ='" & txtRepSta.Text & "', [TimeRes] = '" & timeToday.Text & "' WHERE DailyID ='" & txtDailyRep.Text & "' AND PatientHp = '" & txtRecNo.Text & "'  ")
                Dim cmd As OleDbCommand = New OleDbCommand(strSQL, OleDbConnection)
                Dim objread As OleDbDataReader
                objread = cmd.ExecuteReader
                MsgBox("Update Success")


Can anyone kindly advise me with this

Answers (1)