L
Larry R Harrison Jr
I have an Access 97 database with 2 tables that have a one-many
relationship. I have a SQL statement in the "one" table which I want to
execute and insert 7 records into the "many" table, and I want them to be
linked to the "main" table.
Problem is, it won't let me run the SQL run as long as the one-many
relationship is established in the relationship window.
The SQL is:
Dim sSQL As String
For stDate = stBegDate To stEndDate
sSQL = "INSERT INTO tblScheduleActual_Test ( date1 ) SELECT #" & stDate & "#
AS Expr1;"
DoCmd.RunSQL sSQL
Next stDate
It loops through the dates of the week and inserts 7 records with successive
dates.
It works fine if I remove the relationship, but I figured the relationship
should be established in the relationship window.
Tips?
LRH
relationship. I have a SQL statement in the "one" table which I want to
execute and insert 7 records into the "many" table, and I want them to be
linked to the "main" table.
Problem is, it won't let me run the SQL run as long as the one-many
relationship is established in the relationship window.
The SQL is:
Dim sSQL As String
For stDate = stBegDate To stEndDate
sSQL = "INSERT INTO tblScheduleActual_Test ( date1 ) SELECT #" & stDate & "#
AS Expr1;"
DoCmd.RunSQL sSQL
Next stDate
It loops through the dates of the week and inserts 7 records with successive
dates.
It works fine if I remove the relationship, but I figured the relationship
should be established in the relationship window.
Tips?
LRH