M
mzaiderman
Trying to automate some code for excel and need to break every 1200
lines to END SUB and Create a new SUB. I can do this with an insert
statement, my issue is trying to cut every 1200 records for each user.
Each user will have about 3000 lines of code, and needs to be split
into 1200 for each. I have an ID field on an autonumber that
identifies the field. Have about 55 users, so about 140,000 records
user code ID
userA text 1
userA text 2
What I have so far is...
Dim Emp As variant, ID as variant
Emp = Me.Employee#
ID = Me.ID
For Emp = 1 to 50
For ID = 1 to 1200
docmd.runsql("insert into tbl_test employeename,id,code")
gotorecord, acnext
next ID
docmd.runsql("insert into tbl_test employeename,id,'END SUB'")
Next Emp
Doesn't seem to be working, can anyone please lend a hand?
Thank you!
lines to END SUB and Create a new SUB. I can do this with an insert
statement, my issue is trying to cut every 1200 records for each user.
Each user will have about 3000 lines of code, and needs to be split
into 1200 for each. I have an ID field on an autonumber that
identifies the field. Have about 55 users, so about 140,000 records
user code ID
userA text 1
userA text 2
What I have so far is...
Dim Emp As variant, ID as variant
Emp = Me.Employee#
ID = Me.ID
For Emp = 1 to 50
For ID = 1 to 1200
docmd.runsql("insert into tbl_test employeename,id,code")
gotorecord, acnext
next ID
docmd.runsql("insert into tbl_test employeename,id,'END SUB'")
Next Emp
Doesn't seem to be working, can anyone please lend a hand?
Thank you!