How to set running number code?

AstonCheah

Registered User.
Local time
Today, 19:43
Joined
Jul 31, 2008
Messages
23
I have a report in continuous format, how do i add a label control to run a running number in each record? example:1,2,3,4,5,6,7,8,9,10... any one can help? thanks.
 
creat a text box in the detail section
set its control source to =1
On the data tab of properties windows set it to running sum
Thats all
 
Khawar,

It works, Thanks alot!!
 
If the solution is so simple then why do you want to make it complicated by using vba
 
I just wonder how the codes run and want to learn more from vba. would appreciate it you could share.
 
Try to make solution as simple as possible

Use code where it is needed and not where access has provided a builtin function
 
Actually i want to learn and use it in VB 08 not access. perhaps i should post in vb08 forum. thanks alot for you advice.
 
vb 2008 and vba are two different things the code which is working in access will nor work in vb 2008 where you may be using crystal reports which also have built in running sum feature but for help on that you have to post in some other forum
 
Khawar,

I agree, why resort to VBA when you don't have to.

Pat,

I'm not so "sure" about the retreat event. Granted that Access will format it's guts out
until something doesn't fit on the page, BUT I don't agree that it will fire the Retreat
event.

There have been a few times that I've wanted it to fire, but when it can span a page
(or maybe not), I haven't seen the event fire.

Again, I'll defer and research some more, but I don't think it behaves properly.

At any rate, Khawar is right, use the running sum.

Wayne
 
Pat,

After minutes of exhaustive research, I don't think Access "backs up" in a
report.

If a Detail line spans a page, it doesn't fire.

If a Detail line won't fit on a page, it doesn't fire.

Does it have something to do with Grouping? Keep all on a page?

In any event, forget the VBA and use the running sum.

Wayne
 

Users who are viewing this thread

Back
Top Bottom