OpenConn()
Dim qqttyy As Integer = Val(ListView1.SelectedItems(0).SubItems(3).Text)
Dim codee As String = ListView1.SelectedItems(0).SubItems(1).Text
OleDa.UpdateCommand.CommandText = "UPDATE Inventry SET QTY = QTY -'" & qqttyy & "'WHERE CODE ='" & codee & "'"
OleDa.UpdateCommand.ExecuteNonQuery()
CloseConn()
hhm_pro992
0
Newbie Poster
Recommended Answers
Jump to PostI'm not up on data bound controls so I can't speak to that, but the query shouldn't have single quotes around numeric fields. Try
"UPDATE Inventry SET QTY = QTY - " & qqttyy & " WHERE CODE = " & codee
Also, you needed a …
Jump to PostOn what line?
All 6 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
hhm_pro992
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
hhm_pro992
0
Newbie Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
hhm_pro992
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.