Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber

Status
Not open for further replies.

richtee

IS-IT--Management
Oct 3, 2002
3
ZA
Hi,
I am writing a report to print a Goods Received Note as output from a Purchase Receipts program. I require each GRN to have a unique sequential number as it is printed. How can I do this please?
 
Ideally this should be done by the database.

If this is no possible add a count variable eg

@GRN Number
whileprintingrecords;

global numbervar GRN:= GRN + 1;


Insert this in your GRN header

This of course will only work for a specific report, if you want to run at a later time you will end up with the same set of numbers. YOu can get over this by creating a parameter and using this to initialise GRN count, this is all manual and will require you to record the last GRN number.

Add an initialise formula to report header

@Initialse GRN Number
whileprintingrecords;

global numbervar GRN:= {?Last GRN+1};

There may be a better way but with out storing it in your database I could not think of one.

Ian


 
You could also just create a Running Total if you are looking for the simplest way out.

~Brian
 
Unique in the world, or unique to that printing?

A simple means would be to use the recordnumber function.

-k
 
Thanks for the suggestions, but I suspect I will have to increment a counter in a separate table, and read from there. The GRN number allocation must be completely automatic, and just carries on sequentially day after day.
Would the running total suggestion store the counter each time...how would it work?
R.
 
No, a Running Total won't handle this.

Your database is likely designed to, but you'd have to share the type of database...

There's usually an autonumber function, perhaps you already have a Goods Received Note table, in which case just add an ID field to it with an autonumber.

Otherwise try posting technical information:

Crystal version
Database used
Example data
Expected output

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top