need help for label printing

R

riyaz

hi

I need ur help in my program to print the labels,
this is my table structure (For eaxmple)

orderno 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 with the following conditions

first it should prompt for Orderno ...

then it ask for the starting serial no and ending serial no for the
particular
orderno entered previously to print the labels

the serialno that came under the above selected limits must be able to print.

then it prompt for "no of copies to print".

finally it print the labels.

i have written a code , but it does not lookup the values based upon the
orderno
can u plz provide me the code to print this label.

regards
niyaz

(e-mail address removed)
 
A

Allen Browne

So you want to print (say) 2 copies of the label for orderno 101 serialno 1,
and then perhaps 6 more labels for orderno 101 and seialno 2, and then...?

If so, I think it would get annoying answering that dialog for every entry.
Consider adding another field to your table to store how many of each label
you want, e.g.:
orderno serialno Quantity
101 1 2
101 2 6
101 3 1
101 4 99
101 5 7
102 1 15
102 2 1
...

You can then use the technique explained in this article:
Printing a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html
 
R

riyaz

hi allen

i am new to the access programing ,so i am quiet struggling in this situation


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.
 
A

Allen Browne

1. Set up tblCount, as described in this article:
http://allenbrowne.com/ser-39.html
You can enter the records manually, or use the code in that link to add the
records if you wish.

2. Create a query.
Add both your table and tblCount.
Make sure there is no line joining the 2 tables in the upper pane of the
query design window.

3. Drag the WordOrder field into the grid.
In the Criteria row under this field, enter:
[workorder number]

4. Drag the serialno field into the grid.
In the Criteria row under this field, enter:
Between [minimum serial number] And [maximum serial number]

5. Drag the CountID from tblCount into the grid.
In the Criteria row under this field, enter:
<= [how many of each label]

6. (Optional). Choose Parameters on the Query menu.
Access opens a dialog asking for the parameters and types.
Enter 4 rows for the 4 parameters, e.g.:
[workorder number] Long
[minimum serial number] Long
[maximum serial number] Long
[how many of each label] Long
(I am assuming here that workorder and serialno are both Number type fields,
not Text type fields.)

7. Save and close the query.

8. Open your report in design view.
Set its RecordSource property to this query.
(RecordSource is on the Data tab of the Properties box.)
 
R

riyaz

Thanks for your help allen, it works ,but the main thing is the First step .

which is the First Step of my condition:

1. Firstly, it should prompt for workorder number.(i.e) if we enter 101

it should only print the serial no's for the workorder 101 that is entered
and not for all other workorders.

my aim is to get the reports for the particular Workorder entered .

2.Secondly is it possible to prompt for "How many copies to print" in the
application

instead of predefining the quantity inside the table as u advised earlier.



Thanks & regards
Niyaz


--
 
A

Allen Browne

A1. One workorder only.
The query I suggested does that.

A2. Prompt for the number of copies.
The query I suggested does that.
 
R

riyaz

Hi allen

yes it s working for single WorkOrder but it does not Prompt for it
and also it does not prompt for No_Of copies to print

this is my Query Design: Whether any problem in Query design

here i have given Criteria for Countid <=10 (Since it doesnot Prompt i
have given
<=10)

field CountID WorkOrder SerialNo
table tblcount tblData tblData
Criteria <= 10 "101" BetWeen 1 & 10

plz suggest me anything to be modify in this query (to Prompt for both
Workorder & No.of Copies)

Thanks & Regards
Niyaz
 
A

Allen Browne

You did not enter the query criteria as I suggested.

Enter the name (not literal numbers) as suggested, including the square
brackets.
 

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