tim.breeding
New member
- Local time
- Today, 09:31
- Joined
- Sep 15, 2007
- Messages
- 7
Situation: I have a table (po_numbers) with 2 columns: po_number, po_used(boolean).
On a form I have a combo box which is populated by a short query
SELECT po_number
FROM po_table
WHERE po_used = False
After I select the PO number I'm trying to run an after_update event to change the selected po_number's po_used to 'true'.
This is what I've tried so far:
Private Sub po_number_AfterUpdate()
Dim strSQL As String
strSQL = "UPDATE po_numbers SET po_numbers.po_used =True" _
& " WHERE(((po_numbers.po_number)=" & [Forms]![po_req]![po_number] & "));"
CurrentDb.Execute strSQL, dbFailOnError
End Sub
It's not working and I'm not that great with access. Someone suggested do and Append query to do the same thing, but I don't really know how to structure it.
Any suggestions?
On a form I have a combo box which is populated by a short query
SELECT po_number
FROM po_table
WHERE po_used = False
After I select the PO number I'm trying to run an after_update event to change the selected po_number's po_used to 'true'.
This is what I've tried so far:
Private Sub po_number_AfterUpdate()
Dim strSQL As String
strSQL = "UPDATE po_numbers SET po_numbers.po_used =True" _
& " WHERE(((po_numbers.po_number)=" & [Forms]![po_req]![po_number] & "));"
CurrentDb.Execute strSQL, dbFailOnError
End Sub
It's not working and I'm not that great with access. Someone suggested do and Append query to do the same thing, but I don't really know how to structure it.
Any suggestions?