Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    68

    Unanswered: Refresh Form when displayed

    I have a form [form1] that displays a list of tickets in a subform. There is
    a button on Form1 that brings you to Form2 which allows you to Add a New
    Ticket. When you exit Form2 you are brought back to Form1.

    Is there anyway to automatically Refresh Form1 after closing Form2?
    Currently I have a "Refresh" button on Form1 that you have to click to
    display the newly added ticket that was added using Form2!

    Hope this all makes sense.

    Thanks in advance for your help

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Can you not just put your refresh on your form_activate event of Form1

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    What about adding:

    Forms!Form1.Refresh

    after adding the new record whilst still in the 2nd form ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Nov 2004
    Posts
    22
    Quote Originally Posted by palto1
    I have a form [form1] that displays a list of tickets in a subform. There is
    a button on Form1 that brings you to Form2 which allows you to Add a New
    Ticket. When you exit Form2 you are brought back to Form1.

    Is there anyway to automatically Refresh Form1 after closing Form2?
    Currently I have a "Refresh" button on Form1 that you have to click to
    display the newly added ticket that was added using Form2!

    Hope this all makes sense.

    Thanks in advance for your help

    I have tried two different methods to achieve this in my databases.

    Method 1
    If Form2 is a popup, the On Activate event of Form1 may not function properly. In this case, put code in the On Close event for Form2 that changes the control on Form1 to your refresh button, then do a sendkeys command to activate the button.

    Something like this:

    Private Sub Form_Close()
    Forms!Form1!Refresh.SetFocus
    SendKeys "~"
    End Sub

    This code assumes that the name of your refresh command button is "Refresh."

    Method 2
    The second method that I have used, which works if Form2 is not a popup, is to put an On Activate event on Form1 that refreshes the form.

    Something like this:

    Private Sub Form_Activate()
    Me.Refresh
    End Sub


    I admit that I am a hack at best, but these have worked for me. Good luck.

    Craig
    rockjock

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •