Autofill datatable columns with increasing numbers (1 Viewer)

sure4sure

New member
Local time
Today, 05:14
Joined
Nov 27, 2006
Messages
3
How to autofill datatable columns with increasing numbers - like the way in Excel? :confused:

Given a datatable with 2 columns : ID & Data.

(a) How to fill the column "Data" with consecutive numbers - 1000, 1001, 1002 ...?
(b) How to fill a specified range of continuous records - eg. records ID100, ID101, ID102 ... ID300 - with (a)?

Many many thanks for any help and discussion!
 

MStef

Registered User.
Local time
Today, 16:14
Joined
Oct 28, 2004
Messages
2,251
Hello sure!

Look at "DemoAutofillA2000.mdb".
I think it is what you need. Adapt it on your task.
Open form1 and try.
 

Attachments

  • DemoAutofillA2000.zip
    11.5 KB · Views: 182

sure4sure

New member
Local time
Today, 05:14
Joined
Nov 27, 2006
Messages
3
Hi MStef,

Thank you for your fast response! But I'm afraid that my description before is not clear enough for expressing what I exactly mean. May I take this chance to post the revised description of the problem. Apologize for any confusion caused. :eek:
------------------------------------------------------------------------------------------
How to fill datatable columns with increasing numbers - like the way in Excel?

Given a datatable with 2 columns : ID & Data.
Supposed that there are 100 EXISTING records.

EXISTING datatable

ID Data
---------------------
1 700
2 400
3 399
...
98 100
99 600
100 500

Resulting datatable

ID Data
---------------------
1 700
2 400
3 300
4 301
5 302
6 303
7 304
8 305
9 306
10 307
...
100 500

Given a form with 3 textfields: StartID, EndID & StartData.

How to fill the datatable (not form) column "Data", in the range of ID specified by user, with consecutive increasing numbers?

Example:

StartID --> 3
EndID -->10
StartData --> 300

Then, in the datatable, fill record with ID 3 with 300 (StartData). And fill the ongoing records (ID4, ID5, ID6...ID10) with consecutive increasing numbers?
--------------------------------------------------------------------------------------
I am sure that you must be able to come up with some good ideas! :)
 

Users who are viewing this thread

Top Bottom