By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,948 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,948 IT Pros & Developers. It's quick & easy.

How to mark a record as "Printed"

P: 7
I am making a database for our factory, for managing production. I have a form for printing job orders(Job Prep) for each item to be produced, which user selects from a combo box, and the form contains a subform(Job Prep Sub), which lists the purchase orders for that item. Info comes from PO detail Query, which gets most of its info from PO detail table.
I have a button on the form, on click, prints current record.
The problem Im having is, after each job order is printed i would like to indicate that it was printed, so the user doesn't print it again. I have a field in PO detail table and Query, named STATUS, which is blank. I would like it to say PRINTED in the field for each record that has been printed. The query only displays Null values in the STATUS column, so the printed records would not show up in Job Prep form.
How do I have the Print button also send "printed" to this column in the table? Is this possible. Thanks for any help.
Chad
Sep 29 '06 #1
Share this Question
Share on Google+
5 Replies


PEB
Expert 100+
P: 1,418
PEB
Hi,

You need to do an update query for the respective ID, or if the field whit the Status is present somewhere in your form to set it to PRINTED!

If You have a problem with one of those metods tell us some more info about the field Status and your tables...

I think that the easiest way is using the direct set of the field, however it depends!

:)
Sep 30 '06 #2

P: 7
Hi,
Thanks for responding. Im still a little confused. I could do an update query to change status to 'printed', but I really need it to automatically change status to 'printed' when the user prints the form for each item.
The job order form has several hundred items, sorted by item ID. When the form is opened, the first record from POdetail Qry appears on the form and the subform displays the details. The user prints the form and then goes on to the next record. I dont want the user to be able to print the first record again, so I am trying to design it so that when the 'print' button is clicked, it will print the form (it does), AND I want it to also add 'printed' into the status column in POdetail Qry for that record. I already have the form filtering and displaying only records with a blank in 'status' field, so if it had 'printed' in the 'status' field, it will not show up as a record on the form, and they will not be able to print it again from that form. I could add a status field onto my form, and have the user manually change it everytime an order is printed, but I'm thinking there has to be a way for it to happen automatically. I am very new to this.
Item ID and Status fields originate in POdetail tbl.
POdetail tbl & POsummary tbl = POdetail Qry

Here is the code for printing the job order. Could I add something to add 'printed' to the status only for item ID's that are printed?

Private Sub PRINT_JOB_Click()
Dim myform As Form
Dim pageno As Integer
pageno = Me.CurrentRecord
Set myform = Screen.ActiveForm
DoCmd.SelectObject acForm, myform.Name, True
DoCmd.PrintOut acPages, pageno, pageno, , 1
DoCmd.SelectObject acForm, myform.Name, False
End Sub

Thanks again.
Chad
Oct 2 '06 #3

PEB
Expert 100+
P: 1,418
PEB
Yeah,

Try:
Expand|Select|Wrap|Line Numbers
  1. Private Sub PRINT_JOB_Click()
  2. Dim myform As Form
  3. Dim pageno As Integer
  4. pageno = Me.CurrentRecord
  5. Set myform = Screen.ActiveForm
  6. DoCmd.SelectObject acForm, myform.Name, True
  7. DoCmd.PrintOut acPages, pageno, pageno, , 1
  8. DoCmd.SelectObject acForm, myform.Name, False
  9. Me![Status]="Printed"
  10. Me.Requery
  11. End Sub
  12.  

:)

Hi,
Thanks for responding. Im still a little confused. I could do an update query to change status to 'printed', but I really need it to automatically change status to 'printed' when the user prints the form for each item.
The job order form has several hundred items, sorted by item ID. When the form is opened, the first record from POdetail Qry appears on the form and the subform displays the details. The user prints the form and then goes on to the next record. I dont want the user to be able to print the first record again, so I am trying to design it so that when the 'print' button is clicked, it will print the form (it does), AND I want it to also add 'printed' into the status column in POdetail Qry for that record. I already have the form filtering and displaying only records with a blank in 'status' field, so if it had 'printed' in the 'status' field, it will not show up as a record on the form, and they will not be able to print it again from that form. I could add a status field onto my form, and have the user manually change it everytime an order is printed, but I'm thinking there has to be a way for it to happen automatically. I am very new to this.
Item ID and Status fields originate in POdetail tbl.
POdetail tbl & POsummary tbl = POdetail Qry

Here is the code for printing the job order. Could I add something to add 'printed' to the status only for item ID's that are printed?

Private Sub PRINT_JOB_Click()
Dim myform As Form
Dim pageno As Integer
pageno = Me.CurrentRecord
Set myform = Screen.ActiveForm
DoCmd.SelectObject acForm, myform.Name, True
DoCmd.PrintOut acPages, pageno, pageno, , 1
DoCmd.SelectObject acForm, myform.Name, False
End Sub

Thanks again.
Chad
Oct 7 '06 #4

P: 7
Thanks, that kinda works. It changes the status to printed, but only for the first record in the subform. How could I get all the related records in the subform to show 'printed'?
Thanks for your help,
Chad
Oct 11 '06 #5

PEB
Expert 100+
P: 1,418
PEB
So

Private Sub PRINT_JOB_Click()
Dim myform As Form
Dim pageno As Integer
Dim i,p
pageno = Me.CurrentRecord
Set myform = Screen.ActiveForm
DoCmd.SelectObject acForm, myform.Name, True
DoCmd.PrintOut acPages, pageno, pageno, , 1
DoCmd.SelectObject acForm, myform.Name, False
p=Screen.ActiveForm.recordset.recordcount
ActiveForm.recordset.MoveFirst
for i =1 to p
ActiveForm.recordset.edit
ActiveForm.recordset("[Status]")="Printed"
ActiveForm.recordset.Update
ActiveForm.recordset.Movenext
next i
Me.Requery
End Sub
Oct 14 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.