473,394 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to mark a record as "Printed"

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
5 4821
PEB
1,418 Expert 1GB
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
SEEMO
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
1,418 Expert 1GB
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
SEEMO
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
1,418 Expert 1GB
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

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

Similar topics

2
by: John Pastrovick | last post by:
I am new to PHP, coming from ASP coding if (HTTP_GET_VARS==1){ print "Yes"; }else{ print "No"; } when "b" is not passed via (http://www.mydomain.com?b=1
6
by: Maria L | last post by:
I have a client who needs to copy an existing sale. The problem is the Sale is made up of three tables: Sale, SaleEquipment, SaleParts. Each sale can have multiple pieces of equipment with...
8
by: Mark | last post by:
My PHP script builds a table that is too wide to fit on the paper. Two of the columns contain strings that are more lengthy than data in the other columns. I can get the table to fit by letting...
3
by: Jeff | last post by:
I have 3 pages of data I need printed for each record, however, Access won't allow me to create a 3 page detail section. Is there any way around this limitation? Thanks in advance Jeff
26
by: Chris Potter | last post by:
Hello everyone. I am taking my first course in C and in one of my assignments i need to print out an array that could have anywhere from 0 to 100 positive integers in it (a negative integer is...
289
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could...
12
by: baumann | last post by:
hi all, printf("%c",b) doesn't work properly. #include <stdio.h> int a , b; char d, e; char * p; float f; int main(int argc, char* argv) {
0
by: Radu | last post by:
Hi. I have finished a web-site - and it runs fine on my dev machine. I have deployed it onto the server, and now I have this (which, by the way, doesn't seem to happen all the time - sometimes I...
30
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.