
fRefreshLinks Doesn't work if path doesn't exist
From the look of it, you're going to raise an error if strDBPath is
not a valid path at the time you say
> If Len(Dir(strDBPath)) = 0 Then
This routine has error-handling, doesn't it? You may want to do
something like this:
Dim strWork As String
On Error Resume Next
strWork = vbNullString
strWork = Dir(strDBPath)
On Error GoTo ... ' original error-handler
If Len(strWork) = 0 Then
'File Doesn't Exist, call GetOpenFileName
' ... and so on
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Quote:
> I am linking my tables through code using fRefreshLinks
> from Dev's website. Everything works fine except when I
> move the database to another computer I get bad file name
> or number error when using:
> If Len(Dir(strDBPath)) = 0 Then
> 'File Doesn't Exist, call GetOpenFileName
> strDBPath = fGetMDBName(strDBPath)
> If strDBPath = vbNullString Then
> 'User pressed cancel
> Err.Raise cERR_USERCANCEL
> End If
> End If
> The path no longer exists and I'm not sure how to get
> around this.
> Chris