Unanswered: dinamical population of a table problem
I have a query that gives me two hours: a start hour and a end hour.
I'm trying to dinamically populate a table with these two hours and all the half hours that stays in the middle.
I copy the first record of the query (startHour) in the new table, then I start a loop that add an half an hour until it reaches the end_hour.
Does someone have an idea?
That's the code till now (same as the just posted thread):
Dim cnn1 As ADODB.Connection
Dim cat1 As New ADOX.Catalog
Dim rst1 As New ADODB.Recordset
Dim rst2 As New ADODB.Recordset
'Set context for populating new table (Timetable)
Set cnn1 = CurrentProject.Connection
Set cat1.ActiveConnection = cnn1
Set rst1.ActiveConnection = cnn1
' Set rst2.ActiveConnection = cnn1
'Open recordsets based on new and original tables
rst1.Open "Timetable", , adOpenKeyset, _
rst2.Open "qry_StartEndHour", cnn1, adOpenForwardOnly, _
'Loop through recordsets to copy from original to new table
Do Until rst2.EOF
.Fields(0) = rst2.Fields(0)