Refreshing the screen after deleting a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im trying to refresh the screen after deleting a record.
This is what is under my delete button.
sql = "DELETE * FROM tbl_memberOverrides "
sql = sql & "WHERE tbl_memberOverrides.MemberID = """ & txtMemberID.Value &
""""
dbs.Execute sql
Me.Refresh


The refresh is not working. Im getting #delete in the text boxes.
Ive tried me.requery
The source = table, the type is a dynaset. Help!
 
Hi Angel:

Those "#deleted" messages are annoying allright! What I usually do to
refresh the dataset is to simply reset the thing manually. This code is
taken from one of my projects. It not only gets rid of the #deleted
messages, but resets a listbox of records on said form to not show the
deleted record anymore (as you can see, a similar method):

Private Sub Command443_Click()
On Error Resume Next
DoCmd.RunSQL "DELETE SOAP.* FROM SOAP WHERE [SOAP].[AUTONO] =
Forms![SOAP]![List101].Value;"
Forms![SOAP].RecordSource = "SELECT SOAP.* FROM SOAP ORDER BY SOAP.DDATE; "
[List101].RowSource = "SELECT [SOAP].[AutoNo], [SOAP].[DDate],
[SOAP].[LUName] FROM SOAP WHERE SOAP.ACCT = Forms![*medical
information]![ACCT] ORDER BY SOAP.DDate;"
MsgBox "Record has been deleted!", vbExclamation
Exit Sub
End Sub

Regards,
Al



Forms!ParentForm.
 
Kind of an overkill. :-)

Why not just use the built-in button wizard, Record Operations > Delete
Record and save yourself the frustration?

HTH,
Nikos
 
Hey Nikos-

I use an UZI to "delete" the flies on my dog. Once their dead, they don't
move... Come to think of it- neither does my dog! Works well, though... 8^O

Al
 
Back
Top