• Open Linked table manager on error? (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Open Linked table manager on error? (2003)

    Author
    Topic
    #417267

    Hello my dear friends,

    In my database I want to check right away if all linked tables are linked correctly. If not, the linked table manager (or a form in the same purpose) should be opened to link all tables to the right positions.

    When I rename my table-backend for testing purposes I get the Error 3044 right away when I start up the database (cuz I have a DLookup in the startup form). Now I tried several approaches such as On Error DoCmd.COmmand.accCmdLinkedTable Manager and so on – nothing worked.

    Maybe you guys can present me a solution?!?

    Thanks
    Dennis

    Viewing 0 reply threads
    Author
    Replies
    • #935746

      Use another form as startup form and test the links there. The Solutions9.mdb sample database from Microsoft Access 2000: Building Applications with Forms and Reports, Sample Applications Download shows how to do this.

      • #935775

        Hmm yeah it’s in tehre but with a lot of code. I thought of something smaller.

        My idea goes as far as this: (no real code, just thought process)

        If Error 3044 On DLookup(Something in some table) Goto Error
        Else Goto NoError

        :Error
        Msg “Linked tables not found”
        DoCmd.Command acCmdLinkedTableManager

        :NoError
        Continue

        I hope you get what I mean. The Microsoft approach just seems a lil bit too much for my needs.

        Dennis

        • #935816

          You could use something like this, where tblLinked is a linked table:

          Private Sub Form_Load()
          Dim lngDummy As Long

          On Error GoTo Err_Handler
          lngDummy = DCount(“*”, “tblLinked”)
          Exit Sub

          Err_Handler:
          MsgBox “Please relink the tables”, vbExclamation
          RunCommand acCmdLinkedTableManager
          End Sub

          Note that it’s RunCommand, not Command, and you don’t need to prefix it with DoCmd.

          • #935892

            Man, that works perfect! Thanks alot.

            Good that I didn’t have to implement that huge solution by microsoft

            Dennis

    Viewing 0 reply threads
    Reply To: Reply #935892 in Open Linked table manager on error? (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel