J
Josh
Boss didn't want to use Autonumber for PO number, since he didn't want
any "skipped" PO numbers. (which means that he has to "void" each
unused PO, but thats what he wants).
On my Purchase Order Form, I have:
Private Sub Form_Current()
If Me.NewRecord Then
Me.PONumber = 1 + DMax("ponumber", "tblpurchaseorders")
Me.Reviewed = -1
Me.cboDepartment = "DefaultDeparment"
Me.Dirty = False
End If
Exit Sub
which works well. Now I'm asked to: Be able to Pre-Print blank PO's,
like the pad of blank PO's they used to give out to a few Departments
to let them print their own PO. Now, they'll print them, but they will
at least be in the 'system' for later followup.
How can I pre-print a set number of blank PO's? I have the blank PO
made, rptBlankPO.
I've made a Form which has an unbound text bo (txtPOblankPrint) for
number or blanks to print, and cboDepartment. What code would I put
in a cmd button?
Something like: (lets say we enter 25 in txtPOblankPrint)
dim POPrintNumber as long
POPrintNumber = me.txtPOblankPrint 'seems like this is needed, just
not sure how to use
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblPurchaseOrders", dbOpenDynaset)
rs.AddNew
rs!POnumber = 1 + DMax("ponumber", "tblpurchaseorders")
rs!Department = me.cboDepartment
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing
How would I keep addings records untill I've added 25 new records?
And, also, while I could probably figure out how to print those
'blank' POs, it would be a separate procedure, probably. Is there
some additional code to print the 25 as part of this procedure?
Thanks, Josh
any "skipped" PO numbers. (which means that he has to "void" each
unused PO, but thats what he wants).
On my Purchase Order Form, I have:
Private Sub Form_Current()
If Me.NewRecord Then
Me.PONumber = 1 + DMax("ponumber", "tblpurchaseorders")
Me.Reviewed = -1
Me.cboDepartment = "DefaultDeparment"
Me.Dirty = False
End If
Exit Sub
which works well. Now I'm asked to: Be able to Pre-Print blank PO's,
like the pad of blank PO's they used to give out to a few Departments
to let them print their own PO. Now, they'll print them, but they will
at least be in the 'system' for later followup.
How can I pre-print a set number of blank PO's? I have the blank PO
made, rptBlankPO.
I've made a Form which has an unbound text bo (txtPOblankPrint) for
number or blanks to print, and cboDepartment. What code would I put
in a cmd button?
Something like: (lets say we enter 25 in txtPOblankPrint)
dim POPrintNumber as long
POPrintNumber = me.txtPOblankPrint 'seems like this is needed, just
not sure how to use
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblPurchaseOrders", dbOpenDynaset)
rs.AddNew
rs!POnumber = 1 + DMax("ponumber", "tblpurchaseorders")
rs!Department = me.cboDepartment
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing
How would I keep addings records untill I've added 25 new records?
And, also, while I could probably figure out how to print those
'blank' POs, it would be a separate procedure, probably. Is there
some additional code to print the 25 as part of this procedure?
Thanks, Josh