I've switch my database from 2003 to 2007 and find a problem with a relink module that I've been using. The code I've been using is RelinkCode and what it does is if the database can not be found it allows you to locate the current database and then relink it. Everything worked great when using 2003 but now with 2007 I get "There is no Object in this control" the code that it stops on is
Hopefully someone can make sense out of this and be able to point me the correct direction.
Thanks for any help as always this is the best place to find answers.
Code:
Public Function Browse()
' Prompts user for Cowboy Action database file name
On Error GoTo Err_Browse
Dim strFileName As String
Dim oDialog As Object
** the next line is where the program stops with the error message
Set oDialog = [Forms]![frmNewDatafile]!xDialog.Object
With oDialog ' Ask for new file location
.DialogTitle = "Please Select new SASS Premier Scoring Files"
.Filter = "Access Database(*.mdb;*.mda;*.mde;*.mdw)|" & _
"*.mdb; *.mda; *.mde; *.mdw|All(*.*)|*.*"
.FilterIndex = 1
.ShowOpen
If Len(.FileName) > 0 Then ' user responded, put selection into text box on
[Forms]![frmNewDatafile]![txtFileName] = .FileName
End If
End With
Exit_Browse:
Exit Function
Thanks for any help as always this is the best place to find answers.
Comment