hi,
i have a loans table and a products table. i want to be able to update the field "borrowed" in the products table THROUGH THE LOANS form in VB6, by updating the recordset. so it would use the productID TO FIND THE RECORD (txtproductID), then update the "borrowed" field for that book.
i have created an adodc, but when i write this code, it says "ERROR. OBJECT VARIABLE OR WITH BLOCK VARIABLE NOT SET." And it highlights the '.open' part
please please help me to accomplish this. i have tried so hard for ages but cannot get it to work
. i would really appreciate it.
thanks
i have a loans table and a products table. i want to be able to update the field "borrowed" in the products table THROUGH THE LOANS form in VB6, by updating the recordset. so it would use the productID TO FIND THE RECORD (txtproductID), then update the "borrowed" field for that book.
i have created an adodc, but when i write this code, it says "ERROR. OBJECT VARIABLE OR WITH BLOCK VARIABLE NOT SET." And it highlights the '.open' part
Code:
Private Sub Command1_Click()
With Adodc1.Recordset
.Open "select [borrowed?] from products where ["borrowed?"= false] And [product id] = '" & txtproductID.Text & "'"", adOpenDynamic, adLockOptimistic"
.MoveFirst
.Fields("borrowed?") = True
.Update
MsgBox "update successful"
End With
please please help me to accomplish this. i have tried so hard for ages but cannot get it to work


thanks
Last edited: