A command button on a form has the following code behind it
First the following code deletes existing date in the table
and then repopulates the table with the following code
When I look at the table after the processes run, each of the fields show #Deleted and yet the data is there. If I run another command button from the form, and pull data from the table, all the data shows. Also, if I open the table, then switch the table to Design view and then back, all of the data shows properly.
Why does #Deleted show in the table?
Tom
Code:
Dim startTime As Double
Dim endTime As Double
Call MsgBox("The Consecutive Months table needs updating." _
& vbCrLf & " This takes 10 seconds or less." _
, vbExclamation, "Updating Consecutive Months table")
startTime = Timer
Call delStreakData3
'clear out the data
'Call PrintStreaks(#1/1/2005#, i)
Call PrintStreaks3(DMin("MeetingDate", "tblAttendanceARCHIVE"), 6)
endTime = Timer
MsgBox "Update completed. Time to update = " & endTime - startTime
First the following code deletes existing date in the table
Code:
Public Sub delStreakData3()
Dim strSql As String
strSql = "Delete * from tblStreakDataARCHIVE"
CurrentDb.Execute strSql
End Sub
and then repopulates the table with the following code
Code:
Public Sub insertStreakData3(memID As Long, startStreak As Date, endDate As Date, StreakLength As Integer)
Dim strSql As String
Dim strValues As String
Dim strStart As String
Dim strEnd As String
strStart = getSQLDate3(startStreak)
strEnd = getSQLDate3(endDate)
strValues = "(" & memID & "," & strStart & "," & strEnd & "," & StreakLength & ")"
'Debug.Print strValues
strSql = "Insert into tblStreakDataARCHIVE (memberID_FK,streakStartDate,streakEndDate,streakLength) values " & strValues
'Debug.Print strSql
CurrentDb.Execute strSql
End Sub
When I look at the table after the processes run, each of the fields show #Deleted and yet the data is there. If I run another command button from the form, and pull data from the table, all the data shows. Also, if I open the table, then switch the table to Design view and then back, all of the data shows properly.
Why does #Deleted show in the table?
Tom