UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Relead/Refresh Form    
 
   
piper3d
post May 4 2005, 03:23 PM
Post #1

UtterAccess Enthusiast
Posts: 74



I have a form which stores it's data in a table. This is standard. I have created a delete query that deletes all of the records from that table. I put a button in the form header that runs the delete query. This works fine.

What doesn't happen is that the form does not get reloaded/refreshed so the contents still show on the form even though they have been deleted. If you click on a record it changes the record and says deleted.

How can I make it so that the screen does a refresh so it gets rid of the deleted records and shows the blank form again?

Basically I want a delete all records from the form and refresh the page.

Any idea's?

Thanks in advance,
Brian Weber
Go to the top of the page
 
+
fkegley
post May 4 2005, 03:46 PM
Post #2

UtterAccess VIP
Posts: 23,583
From: Mississippi



In the code for the button, after the delete query runs, you need

Me.Requery
Go to the top of the page
 
+
piper3d
post May 4 2005, 04:01 PM
Post #3

UtterAccess Enthusiast
Posts: 74



I tried that. It does not work.

Here is the code for the button. It is an on click event.

Private Sub Command26_Click()
On Error GoTo Err_Command26_Click

Dim stDocName As String

stDocName = "qryITEMS01_D"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.Requery

Exit_Command26_Click:
Exit Sub

Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click

End Sub

Brian Weber
Go to the top of the page
 
+
fkegley
post May 4 2005, 04:24 PM
Post #4

UtterAccess VIP
Posts: 23,583
From: Mississippi



I did it like this:

Dim stDocName As String
stDocName = "Query12"
DoCmd.OpenQuery stDocName, acNormal, acEdit

DoCmd.Close
DoCmd.OpenForm "CopyOfCategories"
Go to the top of the page
 
+
piper3d
post May 5 2005, 07:43 AM
Post #5

UtterAccess Enthusiast
Posts: 74



It's working now.

Silly me, I was editing code for another button by mistake.

The me.requery works too.

Thanks for the help.

Brian Weber
Go to the top of the page
 
+
fkegley
post May 5 2005, 09:11 AM
Post #6

UtterAccess VIP
Posts: 23,583
From: Mississippi



You're welcome.
Go to the top of the page
 
+
natashaepperson
post May 5 2005, 04:55 PM
Post #7

UtterAccess Guru
Posts: 686
From: Houston TX



Nevermind =)

i got it, I looked at some of your older posts =)

Private Sub Refresh_Click()
Dim stDocName As String
stDocName = "qry_PO_Master"
Me.Requery

End Sub
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 11:29 AM