Clear records from a split form

Skip Bisconer

Who Me?
Local time
Yesterday, 23:32
Joined
Jan 22, 2008
Messages
285
I have a split form to update a table and on the form I have a clear button to clear the table for the next entries. I want the split form to requery the table after the delete query runs in the data portion of the split form I get the #Deleted in all the data fields. I know that the table is empty but it confuses the user and looks terrible in general. I would use vba to open and close the form to eliminate the problem but there is several key unbound text fields that I don't want to have to repopulate. Please check my code or give me suggestions as to correct the issue.

Code:
Private Sub Command20_Click()
On Error GoTo Err
'Clears the tblSelectedOrderNumber table for new entries
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteSelectedOrderLines"
DoCmd.Requery "tblSelectedOrderNumber"
DoCmd.SetWarnings True
OEOO_ORDR = ""
txtRecCount = 0
Err:
DoCmd.SetWarnings True
End Sub
 
Also, this line is not needed:

DoCmd.Requery "tblSelectedOrderNumber"
 
Thanks for your input. This will solve my problem.
 

Users who are viewing this thread

Back
Top Bottom