There is no object in this control.

I just install install Office 2003 on a Windows 7 64 bit machine. I have control that uses the xdialog.object to browe folders. I get an error message that "There is no object in this control." That object was there when it ran under windowsXP but now is blank. Is there a solution to this problem? Attached is the code that I am using.
Public Function Browse()
        ' Prompts user for back-end database file name.
        On Error GoTo Err_Browse
        Dim strFileName As String
        Dim oDialog As Object
        Set oDialog = [Forms]![frmNewDataFile]!xDialog.Object
        With oDialog   ' Ask for new file location.
          .DialogTitle = "Please Select New Data File"
          .Filter = "Access Database(*.mdb;*.mda;*.mde;*.mdw)|" & _
          "*.mdb; *.mda; *.mde; *.mdw|All(*.*)|*.*"
          .FilterIndex = 1
          .ShowOpen
          ' If user responded, put selection into text box on form.
          If Len(.filename) > 0 Then _
          [Forms]![frmNewDataFile]![txtFileName] = .filename
        End With

Exit_Browse:
           Exit Function
Err_Browse:

           MsgBox Err.Description
           Resume Exit_Browse

        End Function

        Public Sub AppendTables()

        Dim db As Database, X As Variant
        ' Add all linked table names into the Unprocessed Collection.
        Set db = CurrentDb
        ClearAll
        For Each X In db.TableDefs
          If Len(X.Connect) > 1 Then
               UnProcessed.Add Item:=X.Name, Key:=X.Name
           End If
        Next

        End Sub

        Public Function ProcessTables()

        Dim db As Database, rst As Recordset, strTest As String
        On Error GoTo Err_BeginLink

        ' Call procedure to add all linked tables into a collection.
        AppendTables

        ' Test for existence of file name\directory selected in
        ' Common Dialog Control.
        strTest = Dir([Forms]![frmNewDataFile]![txtFileName])

        On Error GoTo Err_BeginLink
        If Len(strTest) = 0 Then   ' File not found.
          MsgBox "File not found. Please try again.", vbExclamation, _
             "Link to new data file"
              Exit Function
        End If

           ' Begin relinking tables.
           Relinktables (strTest)
           ' Check to see if all tables have been relinked.
           CheckifComplete

           DoCmd.Echo True, "Done"
             
            'Add path to the user setup table
            Set db = CurrentDb()
            Set rst = db.OpenRecordset("UserSetup", dbOpenTable)
            rst.Index = "PrimaryKey"
            rst.Seek "=", 1
            If Not rst.NoMatch Then
                rst.Edit
                    rst!datalocation = [Forms]![frmNewDataFile]![txtFileName]
                rst.Update
            End If
             
            If UnProcessed.Count < 1 Then
               MsgBox "Linking to new back-end data file was successful."
            Else
               MsgBox "Not All back-end tables were successfully relinked"
            End If
           
            DoCmd.close acForm, [Forms]![frmNewDataFile].Name

Exit_BeginLink:
              DoCmd.Echo True
              Exit Function

Err_BeginLink:
               Debug.Print Err.Number
               If Err.Number = 457 Then
                   ClearAll
                   Resume Next
               End If
               MsgBox Err.Description
               Resume Exit_BeginLink

           End Function

           Public Sub ClearAll()

           Dim X
           ' Clear any and all names from the Unprocessed Collection.
           For Each X In UnProcessed
             UnProcessed.Remove (X)
           Next
           End Sub

           Public Function Relinktables(strFileName As String)

           Dim dbbackend As Database, dblocal As Database, ws As Workspace, _
               X, y
           Dim tdlocal As TableDef

           On Error GoTo Err_Relink

           Set dbbackend = DBEngine(0).OpenDatabase(strFileName)
           Set dblocal = CurrentDb

           ' If the local linked table name is found in the back-end database
           ' we're looking at, Recreate & Refresh its connect string, and
           ' then remove its name from the Unprocessed collection.
            For Each X In UnProcessed
               If Len(dblocal.TableDefs(X).Connect) > 0 Then
                 For Each y In dbbackend.TableDefs
                    If y.Name = X Then
                       Set tdlocal = dblocal.TableDefs(X)
                       tdlocal.Connect = ";DATABASE=" & _
                       Trim([Forms]![frmNewDataFile]![txtFileName])
                       tdlocal.RefreshLink
                       UnProcessed.Remove (X)
                    End If
            Next
               End If
           Next

Exit_Relink:
              Exit Function
Err_Relink:
              MsgBox Err.Description
              Resume Exit_Relink

           End Function

Public Sub CheckifComplete()
Dim strTest As String, y As String, notfound As String, X
On Error GoTo Err_BeginLink

' If there are any names left in the unprocessed collection,
' then continue.
If UnProcessed.Count > 0 Then
    For Each X In UnProcessed
        notfound = notfound & X & Chr(13)
    Next
    
    ' List the tables that have not yet been relinked.
    y = MsgBox("The following tables were not found in " & _
    Chr(13) & Chr(13) & [Forms]![frmNewDataFile]!txtFileName _
    & ":" & Chr(13) & Chr(13) & notfound & Chr(13) & _
    "Select another database that contains the additional tables?", _
    vbQuestion + vbYesNo, "Tables not found")

    If y = vbNo Then
        Exit Sub
    End If

    ' Bring the Common Dialog Control back up.
    Browse
    strTest = Dir([Forms]![frmNewDataFile]![txtFileName])
    If Len(strTest) = 0 Then   ' File not found.
        MsgBox "File not found. Please try again.", vbExclamation, _
        "Link to new data file"
        Exit Sub
    End If
    Debug.Print "Break"
    Relinktables (strTest)
Else
    Exit Sub
End If
    CheckifComplete

Exit_BeginLink:
              DoCmd.Echo True   ' Just in case of error jump.
              DoCmd.Hourglass False
              Exit Sub

Err_BeginLink:
              Debug.Print Err.Number
              If Err.Number = 457 Then
                 ClearAll
                 Resume Next
              End If
              MsgBox Err.Description
              Resume Exit_BeginLink

End Sub

Open in new window

dlord54Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Tools>>References... look for any listed as:

**MISSING ...

mx
0
danishaniCommented:
Check for MISSING references, if so, then find it again, re-register the ActiveX object.

Personally I would go for using the FileDialog, see for example below thread:
http://msdn.microsoft.com/en-us/library/aa195878%28v=office.11%29.aspx

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dlord54Author Commented:
There are no missing references. But it think I will try the FileDialog solution if that will end the problem first.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
It's pretty much just this simple (see image) ... and you will need a Reference set to Office Object Library - see image.
Capture1.gif
Capture2.gif
0
dlord54Author Commented:
The FileDialog worked perfectly. Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Office Productivity

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.