Hi,
i need help in condensing the following vba statement, i have a total of 35 sql to insert.
How to i use the Do...while or For... Next to shorten the statements?
SQL1 = "INSERT INTO tbl_shiftPlan([Date],[S#1],[S#2],[S#3],[S#4],[S#5],[S#6]) VALUES('" & InsertDate & "',' ',' ','2','1','1',' ')"
SQL2 = "INSERT INTO tbl_shiftPlan([Date],[S#1],[S#2],[S#3],[S#4],[S#5],[S#6]) VALUES('" & InsertDate & "','2',' ',' ','1','1',' ')"
..........
DoCmd.RunSQL SQL1
DoCmd.RunSQL SQL2
.........
i need help in condensing the following vba statement, i have a total of 35 sql to insert.
How to i use the Do...while or For... Next to shorten the statements?
SQL1 = "INSERT INTO tbl_shiftPlan([Date],[S#1],[S#2],[S#3],[S#4],[S#5],[S#6]) VALUES('" & InsertDate & "',' ',' ','2','1','1',' ')"
SQL2 = "INSERT INTO tbl_shiftPlan([Date],[S#1],[S#2],[S#3],[S#4],[S#5],[S#6]) VALUES('" & InsertDate & "','2',' ',' ','1','1',' ')"
..........
DoCmd.RunSQL SQL1
DoCmd.RunSQL SQL2
.........