G
Guest
I need to create excel workbooks for each RespId in table tblResp. Within
this workbook, sheets must be created for each account record in tblGLData
that has a link to tblResp. On these sheets, account and account balance data
would be inserted into each sheet.
I have successfully used ADO and automation to create and do this type of
thing for one sheet, but cant determine how to create the routine to create a
workbook, insert sheets, then loop and create another workbook with sheets
for the next group. The SQL statement I use to assign the record source is
for the entire group. I tried to create two ADO record sources under one ADO
connection, but returned errors when I tried to open the 2nd recordset.
How can I do this? Below is a representation of the tables I am working with
Table: tblResp
RespId RespDescription
1 Payroll Clerk
2 AP Clerk
3 AR Clerk
Table: tblGLdata
Account AcctBalance RespId
111000 100.23 1
111001 200.34 1
112000 900.34 1
200000 1000 2
300000 50.34 3
400000 500.55 3
this workbook, sheets must be created for each account record in tblGLData
that has a link to tblResp. On these sheets, account and account balance data
would be inserted into each sheet.
I have successfully used ADO and automation to create and do this type of
thing for one sheet, but cant determine how to create the routine to create a
workbook, insert sheets, then loop and create another workbook with sheets
for the next group. The SQL statement I use to assign the record source is
for the entire group. I tried to create two ADO record sources under one ADO
connection, but returned errors when I tried to open the 2nd recordset.
How can I do this? Below is a representation of the tables I am working with
Table: tblResp
RespId RespDescription
1 Payroll Clerk
2 AP Clerk
3 AR Clerk
Table: tblGLdata
Account AcctBalance RespId
111000 100.23 1
111001 200.34 1
112000 900.34 1
200000 1000 2
300000 50.34 3
400000 500.55 3