khodr
Experts still Learn
- Local time
- Today, 10:17
- Joined
- Dec 3, 2012
- Messages
- 112
Hello Guys
Using SQL with Double Clicking the PurchaseOrderNo I want to update my data in the tblProducts for the data into pQTYinStock
I wrote the below code when I double click to run the Code everything seems to be OK, and no errors shows up, but my data is not updating enclosed find attached all the needed JPGS for my table design, relations between tables, table data, as well as form view, it is driving me crazy. something wrong in the code but i can't find it out. your help highly appreicated.
Private Sub PurchaseOrderNo_DblClick(Cancel As Integer)
Dim rs As DAO.Recordset
Dim dbData As Database
Dim strSQL As String
Set dbData = CurrentDb
strSQL = "Select * from tblProducts where pName = """ & Me.ProductType & """;"
Set rs = dbData.OpenRecordset(strSQL, dbOpenSnapshot)
Do While Not rs.EOF
rs.Edit
rs!pQtyInStock = Me.Requestedty
rs.Update
rs.MoveNext
Loop
End Sub
Using SQL with Double Clicking the PurchaseOrderNo I want to update my data in the tblProducts for the data into pQTYinStock
I wrote the below code when I double click to run the Code everything seems to be OK, and no errors shows up, but my data is not updating enclosed find attached all the needed JPGS for my table design, relations between tables, table data, as well as form view, it is driving me crazy. something wrong in the code but i can't find it out. your help highly appreicated.
Private Sub PurchaseOrderNo_DblClick(Cancel As Integer)
Dim rs As DAO.Recordset
Dim dbData As Database
Dim strSQL As String
Set dbData = CurrentDb
strSQL = "Select * from tblProducts where pName = """ & Me.ProductType & """;"
Set rs = dbData.OpenRecordset(strSQL, dbOpenSnapshot)
Do While Not rs.EOF
rs.Edit
rs!pQtyInStock = Me.Requestedty
rs.Update
rs.MoveNext
Loop
End Sub