how to print like 1 of 10, 2 of 10 in report

sachinmalik007

Registered User.
Local time
Today, 10:42
Joined
May 2, 2012
Messages
11
i have a table with the following field

item code
item name
date
grn No.
nos of container


suppose i have 5 nos of container then i want to print report like

item code : 0025
item name : XXXX
Date : 01/04/2012
GRN No : PM 005
Container : 1 of 5

Next...............

item code : 0025
item name : XXXX
Date : 01/04/2012
GRN No : PM 005
Container : 2 of 5

Next.....................

item code : 0025
item name : XXXX
Date : 01/04/2012
GRN No : PM 005
Container : 3 of 5

and so on....................

Thanks in Advance...............
 
OK, so I think I'm right in saying that the values 1, 2, 3 etc. are what is held in your 'nos of container' field?

There may be a better way of doing this but one way is on your form create an unbound text box which will hold the total number of containers (i.e. 5 from your example above). Let's assume it's called txtTotal.

I'll assume you're basing your report on a Table and I'll call it tblContainer for now. (If it is on a query or table of different name, amend code below as appropriate).

In the OnLoad event of the Report, add:

Code:
Dim intTotal as integer

intTotal = DCount("*","tblContainer")

Me.txtTotal = intTotal

So, on your form you'll have a Text Box displaying the value of the 'nos of container' field, then a Label saying 'Of' and then your txtTotal box.

I'm sure someone can find a slicker method, but this should work.
 

Users who are viewing this thread

Back
Top Bottom