lehcarrodan
Registered User.
- Local time
- Today, 11:30
- Joined
- Feb 20, 2017
- Messages
- 11
Having trouble getting the WHERE part to work. I know everything else's right because if I remove the WHERE section it updates all the qryPayments Paid field to true. I have a text box on a continuous form called txtStillOwing and I want when
txtStillOwing=0 to make paid=true
it's a currency field and I'm not sure I can reference the form like this? or is there an issue with the 0 do I need some quotes or something?
My CODE gives error 3061 Too few parameters. Expected 1.
Private Sub cmdPay_Click()
Me.Requery
Dim RecordSet
Set RecordSet = CurrentDb.OpenRecordset("qryPayments")
Do Until RecordSet.EOF
CurrentDb.Execute "UPDATE tblOrders SET tblOrders.Paid = true WHERE [Forms]![frmAccountReceivable]![txtStillOwing]=0"
RecordSet.MoveNext
Loop
RecordSet.Close
Set RecordSet = Nothing
CurrentDb.Close
Me.Requery
End Sub
Thanks for any help/suggestions!
txtStillOwing=0 to make paid=true
it's a currency field and I'm not sure I can reference the form like this? or is there an issue with the 0 do I need some quotes or something?
My CODE gives error 3061 Too few parameters. Expected 1.
Private Sub cmdPay_Click()
Me.Requery
Dim RecordSet
Set RecordSet = CurrentDb.OpenRecordset("qryPayments")
Do Until RecordSet.EOF
CurrentDb.Execute "UPDATE tblOrders SET tblOrders.Paid = true WHERE [Forms]![frmAccountReceivable]![txtStillOwing]=0"
RecordSet.MoveNext
Loop
RecordSet.Close
Set RecordSet = Nothing
CurrentDb.Close
Me.Requery
End Sub
Thanks for any help/suggestions!