Answers mostly inline ...... (I think I answered all of the questions) 
Code:
Private Sub CreateAllNServDateRecs_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
' Dim tblNonServDays As DAO.Recordset '<-- This declaration not used - line should be deleted
' Dim tblNonServAllDatesTemp As DAO.Recordset '<-- This declaration not used - line should be deleted
Dim datDate As Date
Dim strSQL As String
Dim sSQL As String ' Could any names be used, eg., str1SQL, str2SQL? Yes any name. Could use Apple and Banana (but not a good idea)
Dim ErrorMsg As String
Dim ErrRecordNum As Long
Set db = CurrentDb
'delete old error messages
CurrentDb.Execute "DELETE * FROM tblInsertErrors", dbFailOnError '<-- this deletes the previous error messages table of records.
Me.Requery '<-- This requeries & refreshes the current (active) form
'I don’t see a similar statement for tblNonServAllDatesTemp. 'Is it not necessary because its opened via the INSERT INTO… statement later?
' Kinda. The table is techniquely not "Opened". It is easier/faster to use the DBE (database engine) to insert the record.
strSQL = "SELECT * FROM tblNonServDays"
Set rs = db.OpenRecordset(strSQL) 'Yes, this creates a recordset object for tblNonServDay.
If Not rs.BOF And Not rs.EOF Then
rs.MoveLast 'Does rs.MoveLast load all the records in the recordset? Yes
rs.MoveFirst ' And then rs.MoveFirst goes to the first record? Yes
Do While Not rs.EOF
datDate = rs![Non Serv Start Date]
If IsDate(rs("[Non Serv End Date]")) Then
Do While datDate <= rs![Non Serv End Date]
strSQL = "INSERT INTO tblNonServAllDatesTemp (Program, [Non Serv Start Date], [Non Serv End Date], datDate)"
strSQL = strSQL & " VALUES (" & rs!Program & ", #" & rs![Non Serv Start Date] & "#, #" & rs![Non Serv End Date] & "#,#" & datDate & "#);" 'Fields in an SQL statement don’t need a dim statement? Correct. You are naming the fields IN THE TABLE that the data is put into
'And modify this statement to:
'strSQL = strSQL & " VALUES (" & rs!Program & ", #" & rs![Non Serv Start Date] & "#, #" & rs![Non Serv End Date] & "#, " & rs![Site Not In Service] & ",#" & datDate & "#);"
'There was a comma missing before the new value and the date delimiters needed to be adjusted
' Debug.Print strSQL 'I assume this would display what’s in strSQL if you were debugging…? Do you have to un-comment it to do so? ' Correct and Yes
db.Execute strSQL, dbFailOnError 'This tells the database to execute the current strSQL commands? Yes, the DBE (ACE)
'Add 1 day
datDate = DateAdd("d", 1, datDate)
Loop
Else
' invalid end date
ErrRecordNum = rs("Non Serv Chg Number")
ErrorMsg = "Invalid DATE at [Non Serv Chg Number] --> " & ErrRecordNum
sSQL = "INSERT INTO tblInsertErrors ( PK_Number, ErrorMsg, ErrorDate )"
sSQL = sSQL & " VALUES (" & ErrRecordNum & ", '" & ErrorMsg & "',#" & Now() & "#);"
' Debug.Print sSQL
db.Execute sSQL, dbFailOnError
Me.Requery
End If
rs.MoveNext 'This moves to the next record in tblNonServDays? Yes
Loop
End If
rs.Close 'Closes tblNonServDays? No, closes the record set "rs"
Set rs = Nothing
Set db = Nothing
MsgBox "Done!"
End Sub
-------------------------------------------------------------
Note: I intend to query tblNonServDays and in the query set the Non Serv End Date = Non Serv Start Date. The query would then be the input rs to this procedure.
There is already a recordset (rs) created on tblNonServDays. No need to open another record set.
Would I “Dim” that in the same manner, eg:
Dim qryNonServDays As DAO.Recordset? NO!
Are close and Set = Nothing not needed for the output table tblNonServAllDatesTemp? If so, why?
The output table was never opened.
The rules are
If you create it, destroy it.
Example: Set db = CurrentDb
Here you created a reference to the currentdb, but you didn't open it. So you destroy it (Set db = Nothing), but not close it.
If you open it, close it.
Example: Set rs = db.OpenRecordset(strSQL)
Here you created a reference to the recordset (rs) AND you opened it (=OpenRecordSet)
Therefore you first close the recordset (rs.Close), then you destroy it (Set rs = Nothing).
-------------------------------------------------------------------------------------------------------------
[/COLOR][/B]BTW, you should NEVER use spaces in object names. Object names refer to fields, tables, forms, queries and reports.
Really bad name examples:
Non Serv End Date better is NonServEndDate or Non_Serv_End_Date
Non Serv Start Date better is NonServStartDate or Non_Serv_Start_Date
Site Not In Service better is SiteNotInService or Site_Not_In_Service