how to refresh main project window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danny

    how to refresh main project window

    HI

    How can I refresh the main project window in code in ms access 2000

    For example, I create a new table, but when I minimize the form, the table
    is not there until I do F5 (refresh).
    I do the db.TableDefs.Re fresh, but I guess this is not applied to the
    project window for tables

    thanks




  • '69 Camaro

    #2
    Re: how to refresh main project window

    Hi, Danny.

    Use the RefreshDatabase Window( ) method of the Application object to show
    new objects that you have created in VBA code. The TableDefs.Refre sh( )
    method will refresh the TableDefs collection after an append or deletion of
    a TableDef object, but doesn't force a refresh of the database window
    itself.

    HTH.
    Gunny

    Coming soon:
    For your Microsoft Access, database development and maintenance needs, see:


    "Danny" <dannywork5@ZER O_SPAMhotmail.c om> wrote in message
    news:kDL1c.7214 $Kb7.2015578@ne ws4.srv.hcvlny. cv.net...[color=blue]
    > HI
    >
    > How can I refresh the main project window in code in ms access 2000
    >
    > For example, I create a new table, but when I minimize the form, the table
    > is not there until I do F5 (refresh).
    > I do the db.TableDefs.Re fresh, but I guess this is not applied to the
    > project window for tables
    >
    > thanks[/color]


    Comment

    • Danny

      #3
      Re: how to refresh main project window

      This is great. Thanks.

      I have another question.
      How can I make sure I remove all memory variables and such in code when I
      close databases and forms.

      Thanks

      "'69 Camaro" <Zero_Spam@Zero Spam.com> wrote in message
      news:c28262$aq0 @library1.airne ws.net...[color=blue]
      > Hi, Danny.
      >
      > Use the RefreshDatabase Window( ) method of the Application object to show
      > new objects that you have created in VBA code. The TableDefs.Refre sh( )
      > method will refresh the TableDefs collection after an append or deletion[/color]
      of[color=blue]
      > a TableDef object, but doesn't force a refresh of the database window
      > itself.
      >
      > HTH.
      > Gunny
      >
      > Coming soon:
      > For your Microsoft Access, database development and maintenance needs,[/color]
      see:[color=blue]
      > http://www.softomagixly.com
      >
      > "Danny" <dannywork5@ZER O_SPAMhotmail.c om> wrote in message
      > news:kDL1c.7214 $Kb7.2015578@ne ws4.srv.hcvlny. cv.net...[color=green]
      > > HI
      > >
      > > How can I refresh the main project window in code in ms access 2000
      > >
      > > For example, I create a new table, but when I minimize the form, the[/color][/color]
      table[color=blue][color=green]
      > > is not there until I do F5 (refresh).
      > > I do the db.TableDefs.Re fresh, but I guess this is not applied to the
      > > project window for tables
      > >
      > > thanks[/color]
      >
      >[/color]


      Comment

      • '69 Camaro

        #4
        Re: how to refresh main project window

        > How can I make sure I remove all memory variables and such in code when I[color=blue]
        > close databases and forms.[/color]

        Unfortunately, no bell goes off to alert you that you've forgotten to
        release memory for objects that are no longer in scope. You'll have to do a
        visual check in your code to make sure that variables for all objects have
        been closed and set to "Nothing" before going out of scope.

        For example, if you have a DAO.Recordset object based upon a Database
        object, then you would need to close the DAO.Recordset object and set the
        variable to "Nothing" first before doing the same for the Database object.
        If you were to set the Database object variable to "Nothing" before you
        tried to close the DAO.Recordset object, then you would get an "Object
        invalid or no longer set" error message and would be unable to release the
        memory for the DAO.Recordset object.

        It's a good idea to release the memory for these objects as soon as your
        code is finished with them, but you also need to make sure that your
        error-handing routines handle the release of memory for the objects that
        your procedures use. To make this simpler to maintain, many VB programmers
        delay releasing the memory for the objects until the very end of the
        procedure, where the error handler will also redirect the logic to flow
        through after an error is handled. That way, programmers only have to code
        memory releases for each object once for each procedure, and they know
        exactly where to look for that visual check when code changes are made
        later.

        HTH.
        Gunny

        Coming soon:
        For your Microsoft Access, database development and maintenance needs, see:


        "Danny" <dannywork5@ZER O_SPAMhotmail.c om> wrote in message
        news:g9M1c.7476 $Kb7.2112539@ne ws4.srv.hcvlny. cv.net...[color=blue]
        > This is great. Thanks.
        >
        > I have another question.
        > How can I make sure I remove all memory variables and such in code when I
        > close databases and forms.
        >
        > Thanks
        >
        > "'69 Camaro" <Zero_Spam@Zero Spam.com> wrote in message
        > news:c28262$aq0 @library1.airne ws.net...[color=green]
        > > Hi, Danny.
        > >
        > > Use the RefreshDatabase Window( ) method of the Application object to[/color][/color]
        show[color=blue][color=green]
        > > new objects that you have created in VBA code. The TableDefs.Refre sh( )
        > > method will refresh the TableDefs collection after an append or deletion[/color]
        > of[color=green]
        > > a TableDef object, but doesn't force a refresh of the database window
        > > itself.
        > >
        > > HTH.
        > > Gunny
        > >
        > > Coming soon:
        > > For your Microsoft Access, database development and maintenance needs,[/color]
        > see:[color=green]
        > > http://www.softomagixly.com
        > >
        > > "Danny" <dannywork5@ZER O_SPAMhotmail.c om> wrote in message
        > > news:kDL1c.7214 $Kb7.2015578@ne ws4.srv.hcvlny. cv.net...[color=darkred]
        > > > HI
        > > >
        > > > How can I refresh the main project window in code in ms access 2000
        > > >
        > > > For example, I create a new table, but when I minimize the form, the[/color][/color]
        > table[color=green][color=darkred]
        > > > is not there until I do F5 (refresh).
        > > > I do the db.TableDefs.Re fresh, but I guess this is not applied to the
        > > > project window for tables
        > > >
        > > > thanks[/color][/color][/color]


        Comment

        Working...