Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing data after delete action

Status
Not open for further replies.

dhanus

Programmer
Jun 17, 2003
28
MY
How do I refresh data in my form after a delete action ?
I have tried using REQUERY after delete but it does not work. The records are not visible in the form unless I exit the form.

My code is as follows :


ElseIf addTransactionYesNo = 7 Then 'If NO


If vNewRec = -1 Then

Set Db = CurrentDb

Set rst5 = Db.OpenRecordset("SELECT * FROM DeliveryProforma WHERE do_no = " & Me![do_no] & "", dbOpenDynaset)

With rst5

.Delete

End With
rst5.Close
Set rst5 = Nothing

vNewRec = 0

 
Have you tried REPAINT?

formname.Repaint

Tiny

Perfection is Everything
If it worked first time we wont be here!
 
Hi Tiny

Thank-you for your help.

I was pressed for time and I used this which I found on one of the threads to solve the problem :

Me.AllowDeletions = True
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
Me.AllowDeletions = False
DoCmd.SetWarnings True
DoCmd.GoToRecord , , acLast

I will try Repaint another time and let you know if it solves the problem.

Cheers !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top