-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
When you "issue" the invoices is when you'd mark each order record as
"billed." If you're doing this from a printed report you can use the
report's Detail_Print() subroutine. E.g.:
Create a report query like this:
SELECT * FROM Orders WHERE Billed = False
Create a query named "qryBillIt" like this:
PARAMETERS thisID Long;
UPDATE Orders SET Billed = True WHERE OrderID = thisID
Then set up the VBA behind the invoice report like this:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Use the OrderID control on the report
' that holds the ID of the currently printing
' invoice order.
Billit Me!OrderID
End Sub
Private Sub BillIt(lngOrderID as Long)
' Sets the Billed column in Orders to True
' for the indicated Order ID
const QRY_BILL = "qryBillIt"
dim db as dao.database
dim qd as dao.querydef
set db = currentdb
set qd = db.querydefs(qry_bill)
qd.Parameters!thisID = lngOrderID
qd.execute
qd.close
db.close
End Sub
One problem w/ this is some people Preview the report & don't send it
to the printer. This will cause the record to be set to Billed=True
without printing/sending the invoice! This can be solved by user
training.
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBP57pqoechKqOuFEgEQL/CQCguP8NwgEsOIBRWnxOLj9e8WPSoBwAn1nK
TBmReMtxJJbUcV9TRmevwE2y
=5KGU
-----END PGP SIGNATURE-----
Don Seckler wrote:
I have a database that is going to be used to do billing on orders. I
sent up a field for each record that is called Billed and is a yes/no
field. I want to do a query that will pull all the records that
haven't been billed, issue them an invoice, then mark the billed field
in those records to yes.
Any ideas?
Thanks in advance!