ADO Recordset Question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Brett S. (BrettS_at_discussions.microsoft.com)
Date: 02/01/05


Date: Tue, 1 Feb 2005 12:59:03 -0800

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"



Relevant Pages

  • Re: ADO Recordset Question
    ... > I need help in ADO syntax for a particular function. ... > which is setup in a flat table format. ... vacc As ADODB.Recordset ...
    (microsoft.public.access.modulesdaovba)
  • Re: Converting decimal time into hh:nn:ss time in ACCESS
    ... around this issue by changing the format from 'mmmm yyyy' (this is how ... decimal field and it gives me the entire month total for each employee. ... I create a report to bring in all of the ... reformat the decimal time to hh:nn:ss with no problem as long as it is ...
    (microsoft.public.access.formscoding)
  • Re: two... two... two questions in one!
    ... four digit employee number onto a page that I then sort to remove all the ... form that I send to payroll so I cannot leave the blank rows. ... > cells with the custom format '00'. ...
    (microsoft.public.excel.programming)
  • Converting decimal time into hh:nn:ss time in ACCESS
    ... around this issue by changing the format from 'mmmm yyyy' (this is how ... decimal field and it gives me the entire month total for each employee. ... I create a report to bring in all of the ... reformat the decimal time to hh:nn:ss with no problem as long as it is ...
    (microsoft.public.access.formscoding)
  • Re: Converting decimal time into hh:nn:ss time in ACCESS
    ... try to retrieve the minute totals I get a date in ACCESS rather than ... around this issue by changing the format from 'mmmm yyyy' (this is how ... decimal field and it gives me the entire month total for each employee. ... I create a report to bring in all of the ...
    (microsoft.public.access.formscoding)