refresh form data

Amy35

Registered User.
Local time
Today, 19:33
Joined
Mar 12, 2002
Messages
53
Seems easy enough but! I have a form that displays all open tickets in tabular format. I have used the wizard to create a command button to refresh the form's data. Trouble is it only refreshes the tickets currently shown. So if a new ticket comes in, that ticket will not be included when the refresh button is hit. I have circumvented the problem and found a fix by inserting the docmd.close and then reopening the form. Trouble is it looks pretty amatuer when the user hits the refresh button and then see's the previous form for a couple seconds and then the current form will open refreshed.
Is there a way to have the previous form hidded when I hit the refresh button? Here's my code:

Private Sub cmdrefreshfromopen_Click()
On Error GoTo Err_cmdrefreshfromopen_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmTabularForm"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdrefreshfromopen_Click:
Exit Sub

Err_cmdrefreshfromopen_Click:
MsgBox Err.Description
Resume Exit_cmdrefreshfromopen_Click

End Sub

Thanks for any help on this.
 
Can you not just use a docmd.requery to refresh you form??
 
Thanks that was it!

can't believe I didn't think of that...guess I'm still on my semi summer vacation mode.
 

Users who are viewing this thread

Back
Top Bottom