M
Mark Kubicki
I've got a command button on a form which clears all of the current entries
in a table, and then adds a default set of entries (from another table)...
Generally, it works fine, but sometimes (I haven't found a pattern yet) the
displayed data is a form full of records marked #deleted# (an no other
records behind those). If I click the button again. All of the correct
entries are displayed. (closing and reopening does not clear the #deleted#
problem)
the (edited) code behind the button is:
Private Sub restorestandrd_Click()
Call DoSQLDeleteProjectNotes(Me)
Call DoSQLAddProjectNotes(Me)
Me.Requery
Me.Refresh
End Sub
----------------------
Public Sub DoSQLDeleteProjectNotes(frm As Access.Form)
Dim sSQL As String
sSQL = "Delete * from Notes"
DoCmd.SetWarnings False
DoCmd.RunSQL sSQL
DoCmd.SetWarnings True
End Sub
----------------------
Public Sub DoSQLAddProjectNotes(frm As Access.Form)
Dim sSQL As String
sSQL = "INSERT INTO Notes(PrintNote, optionNumber, Options) " & _
"SELECT OptionRequired, null, Options " & _
"from optNotes " & _
"WHERE OptionRequired = True ;"
DoCmd.SetWarnings False
DoCmd.RunSQL sSQL
DoCmd.SetWarnings True
End Sub
in a table, and then adds a default set of entries (from another table)...
Generally, it works fine, but sometimes (I haven't found a pattern yet) the
displayed data is a form full of records marked #deleted# (an no other
records behind those). If I click the button again. All of the correct
entries are displayed. (closing and reopening does not clear the #deleted#
problem)
the (edited) code behind the button is:
Private Sub restorestandrd_Click()
Call DoSQLDeleteProjectNotes(Me)
Call DoSQLAddProjectNotes(Me)
Me.Requery
Me.Refresh
End Sub
----------------------
Public Sub DoSQLDeleteProjectNotes(frm As Access.Form)
Dim sSQL As String
sSQL = "Delete * from Notes"
DoCmd.SetWarnings False
DoCmd.RunSQL sSQL
DoCmd.SetWarnings True
End Sub
----------------------
Public Sub DoSQLAddProjectNotes(frm As Access.Form)
Dim sSQL As String
sSQL = "INSERT INTO Notes(PrintNote, optionNumber, Options) " & _
"SELECT OptionRequired, null, Options " & _
"from optNotes " & _
"WHERE OptionRequired = True ;"
DoCmd.SetWarnings False
DoCmd.RunSQL sSQL
DoCmd.SetWarnings True
End Sub