Need sample code for the label print

R

riyaz

dear mvp's

I need your help to give a sample code for the following situation, As i
have tried other ways i can't get it.

this is my table structure (For eaxmple)

workorder serialno

101 1
101 2
101 3
101 4
101 5
102 1
102 2
102 3
102 4
102 5

using this table i have to print the labels for the following situations:

1.it should prompt for workorder:
(each workorder have 5 to 10 serial no here i have given 5 serial no's for
single workorder for example)

2.secondly it prompts for "Staring serial no" & "ending serial no".This
is because

for example :: if i enter starting serialno = 2 & ending serial no=5

it should only print the labels for the serialno starting from 2 to 5 for
the corresponding workorder that is entered in the first step (i.e) 2,3,4,5


3.lastly it prompts for "no.of copies to print for the above selected serial
no's"


plz give me some solutions.Whether this condition is possible or not.


regards
riyaz
 
A

Alex Dybenko

Hi,
i think best if you make a form with workorder textbox, serail from-to
textboxes, number of copies textbox and print button
then you build a query for your report based on workorder and serial
criteria, and print report using docmd.printout method, where you can
specify numbe of copies
 
R

riyaz

hi alex

as i am beginner in access programming i face quiet complexity in writing
this(label printing) criteria

can u plz give me the program(coding) for the below given conditions.


regards
Niyaz
 
A

Alex Dybenko

Hi,
say you have a report called MyReport
create a new form wth mentioned textboxes
modify your report rowsource, so criteria based on workorder textbox, serail
from-to textboxes (you can easy do this using expression builder (build
button))
add a command button Print on your form
add code to it click event:

docmd.SelectObject acReport,"MyReport",true
docmd.PrintOut acPrintAll,,,,me.NumberOfCopies

You could also add some verification that user enter proper values in
mentione textboxes
HTH
--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
R

riyaz

Dear alex

as i have already got suggestions from your side for the past conditions,
now there s a critical conditions to be newly wriiten for that label , can
you plz give me some codes to print this label..

my table :

workorder Quantity in serialNo StartingSerialno

101 20 1
102 30 1
103 25 1
104 50 1

Table structure:

1.the quantity(Serial no) field for the particular Workorder which is fixed.

2.the StartingSerialno field all the values are set to 1 Default.
(changes whenever user enter the StartingSerialno which are above the stored
value)

condition:

1.promt for WorkOrder : 101

2.prompt for starting Serial no : 10

here if a user enter the value 10, then it should be saved in the database
for the StartingStartingSerialno field. whenever the user changes the
starting serial no , if it is above the stored value in d/b it should be
saved in the database.


3. promt for ending serialno: 20

4. promt for no of copies : 2

print label.
note : this example is for First time changing the Starting serialno from
default 1 to 10.

since the Quantity for the WOrkorder is 20 , the user can enter the
follwing

startingserial no =10
ending serialno= 20


everytime the startingserialno changed by the user the quantity remains same
for the workorder and the Quantity must synchronise with the changed
StartingSerialno

then it should print with workorder 101

with the serial from 10 to 20 in the label report.

the above example is first time changing the S'Serial no

after update my table :

workorder Quantity in serialno StartingSerialno

101 20 10
102 30 1
103 25 1
104 50 1

main thing is that when another user take the print out ,he cannot enter
the startingSerialno below 10 for the

same workOrder 101

and it is understood that user can print label with

starting serialno 10
ending serialno 30

no of copies 2


plz give me some codes to manipulate this ,Hope u understand my conditions
in the table.

regards
Niyaz

(e-mail address removed)
 
R

riyaz

hi alex

can you plz provide me the Code for the following condition( Newly modified)

table structure:


workorder Quantity in serialNo StartingSerialno

101 20 1
102 30 1
103 25 1
104 50 1

all the Starting Serial no is set 1 Default,(if I change this 1 in future to
some values ,it should Shynronize with Quantity (Maximum limit of ending
Serial no).


Prompt For Workorder: 101

promt for Staring Serial no: 2
Promt for Ending Serial no: 20
no .of copies : 1
then it should Print like this

101 101 101 101 101 101 ......101
2 3 4 5 6 7 20

plz make note that the field Quantity in Serial no is the maximum limit for
Ending Serial no ;

in the above Example i have given the value (Starting Serialno) 2 to
20(Ending Serial no)

thanks & Regards

Niyaz

(e-mail address removed)
 
A

Alex Dybenko

Hi,
not clear what data you need to print with your labels
but I thinking that you need to make a table with one field, fill in with
numbers from 1 to 50
then make a query, where define criteria, in your case Serial between 2 and
20, also add workorder number
now you can run a labels report based on this query

HTH
 
R

riyaz

hi alex

i cannot get you, can you plz write a criteria for the below conditions:
i need more help from you for this condition, As i am new to programming i
feel quiet hard.

the actual condition is the following:

this is my table structure:

workorder StartingSerialno Maximum EndingSerialno

101 1 20
102 1 30
103 1 25
104 1 80

By Default aal Starting Serial No is 1 .


For Example if a user run the report

it will prompt for WorkOrder === 102

prompt For Starting Serial No === 6

prompt For Ending Serial no === 10

(Every Time user enter Different Starting Serial no & Ending SerialNo)

prompt for number of copies === 2

Example Result:
it should have result like this:


102 102 102 102 102 102 102 102 102 102
6 6 7 7 8 8 9 9 10 10

waiting for your reply

Thanks & regards

niyaz.

(e-mail address removed)
 
A

Alex Dybenko

if you would use table (tblSerail) from my previous post, and form with
criteria entry called frmEntry - then query SQL will look like

Select Forms!frmEntry!WorkOrder as WorkOrder, SerialNo From tblSerial
Where SerialNo between Forms!frmEntry![Starting Serial No] and
Forms!frmEntry![Ending Serial no]

HTH
 
R

riyaz

dear alex,

thanks for your help in your previous Suggestion .It Helped me.

Now i need some simple report format as mentioned below.
I need to get the label print out with some conditions.

same table structure:

workorder StartingSerialno Maximum EndingSerialno

101 1 20
102 1 30
103 1 25
104 1 80


prompt for Workorder: 101

prompt for Starting Serialno : 2

prompt for ending Serialno : 15

( I also need to Display Error message if ending Serialno exceeds the
maximum limit in the table)

output Result: simple format which has just sartingserialno & Ending
Serial no as entered only.

101
2 to 15 ( to -- Actual text in the report)

the above report is only to know the limits of the serialno's.


regards
Niyaz.
 
A

Alex Dybenko

Hi,
try to make a multi-column report - I think this is what you need
or try to run a label report wizard, based on this query
 
R

riyaz

hi alex

i have done it, just by creating unbound text box in the report with the
control source [starting Serial no] and [ending Serialno].

plz help me , how to give error message or warnings, when
the EndingSerialno exceed the limit .

plz advise me , give some sample codes to generate error message or warnings
in the report..

now my report only shows #error .when i enter the EndingSerialno above the
limit.

regards
Niyaz
 
R

riyaz

hi alex

i don't build the filter form,but i have done it just writing a query itself.

Now , i want to have a warning or a error message to be generated whenever

the user enter the endingSerialno above the limit(Which is in the table).

plz help me, how to create a error message for this condition in the report.

Thanks & Regards
Niyaz
 
A

Alex Dybenko

you can not generate warning or error message using query parameters, that
is why I suggested you to build a form...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top