G
Guest
I need help in ADO syntax for a particular function. I have a table (table1)
which is setup in a flat table format. It tracks employees, particular
events, and the dates the events occur on. It has this format:
Emp_No, EventType1, EventType1Date1, EventType1Date2, EventType2,
EventType2Date1.......
I need to insert rows into another table (table2) which has this format:
Emp_No, EventType, EventDate
I need ADO syntax of how to evaluate the recordset formed from table1 and
insert the rows into table2. Not every employee has an entry for every event
type or event type date. There only should be rows in table2 when an employee
has an occurence of a particular event.
Here is the ADO code I have so far. Can anyone help me fill in the part to
evaluate the table1 recordset and create the table2 records? Thanks
Dim cn As ADODB.Connection, vacc As ADODB.Recordset
Set cn = CurrentProject.Connection
Set vacc = New ADODB.Recordset
With vacc
.ActiveConnection = cn
.Open Source:="SELECT * FROM table1"
which is setup in a flat table format. It tracks employees, particular
events, and the dates the events occur on. It has this format:
Emp_No, EventType1, EventType1Date1, EventType1Date2, EventType2,
EventType2Date1.......
I need to insert rows into another table (table2) which has this format:
Emp_No, EventType, EventDate
I need ADO syntax of how to evaluate the recordset formed from table1 and
insert the rows into table2. Not every employee has an entry for every event
type or event type date. There only should be rows in table2 when an employee
has an occurence of a particular event.
Here is the ADO code I have so far. Can anyone help me fill in the part to
evaluate the table1 recordset and create the table2 records? Thanks
Dim cn As ADODB.Connection, vacc As ADODB.Recordset
Set cn = CurrentProject.Connection
Set vacc = New ADODB.Recordset
With vacc
.ActiveConnection = cn
.Open Source:="SELECT * FROM table1"