1) I have a table Tbl_Billings : SysCounter, Long Integer, AutoNumber, Primary key FK_Sales, Long Integer Date_Of_Billing, Date/Time Billed, Yes/No, Default value = 0 FK_Sales is a foreing key that points to a Tbl_Sales table that contains the sales data.
2) I have a form Frm_Billings with a combo Combo_Billings and a command button Button_BillIt. The RowSource property of the combo is set to:
SELECT FK_Sales FROM Tbl_Billings WHERE Billed=False;
3) When I click the Button_BillIt command button the following code is executed:
Private Sub Button_BillIt_Click()
Dim strSQL As String
' Do what is necessary for billing a sale
' (create an invoice etc.).
' ---< Code for billing a sale comes here.>---
' Timestamp and mark the newly processed sale as billed
' in the tbl_Billings table and adjust the combo accordingly.
strSQL = "UPDATE Tbl_Billings " & _
"SET Billed = True, Date_Of_Billing = #" & Date & "#" & _
"WHERE SysCounter = " & Me.Combo_Sales.Value
CurrentDb.Execute strSQL, dbSeeChanges
Me.Combo_Billings.Value = Null