Hi,
I had an application developed with another developer in Access 2003, our company has upgraded our laptops to Microsoft Office 2010 and now when I open a form (frm_Enq_Address_Dialog) I receive an error on Form load as
"File Path not Found (You entered an expression that has an invalid reference to th eproperty FileSearch)"
As noted, this appeared when Access was upgraded to Access2010 in our laptops - I believe the code that causes this error is below;
Any help highly appreaciated...
Thank you
I had an application developed with another developer in Access 2003, our company has upgraded our laptops to Microsoft Office 2010 and now when I open a form (frm_Enq_Address_Dialog) I receive an error on Form load as
"File Path not Found (You entered an expression that has an invalid reference to th eproperty FileSearch)"
As noted, this appeared when Access was upgraded to Access2010 in our laptops - I believe the code that causes this error is below;
Code:
Private Sub Form_Timer()
If XRefUpdate = 1 Then
Else
DoCmd.Hourglass True
XRef.Requery
XRef2.Requery
XRef3.Requery
XRefUpdate = 1
Wait = vbNullString
Job.Visible = True
CoName.Visible = True
Line1.Visible = True
Line2.Visible = True
Town.Visible = True
[County/Country].Visible = True
PostCode.Visible = True
Contact.Visible = True
If DLookup("KeyWordIDNo", "tbl_Enquiry_Details", "QueryID =" & QueryIDNo) = 16 Then
KeyWord.ForeColor = 255
End If
Call Search
'HYPERLINK
With lblAppendix
If DLookup("MediaIDNo", "tbl_Enquiry_Details", "QueryID =" & QueryIDNo) = 2 Then
If AttachST = 1 Then
.HyperlinkAddress = AttachmentPath & Fname
.Caption = "Fetch.Appendix@" & Fname
.ForeColor = 16711680
.BackColor = 16777215
Else
.HyperlinkAddress = vbNullString
.Caption = "Attachment is not available!"
.ForeColor = 16777215
.BackColor = 255
End If
Else
.Visible = False
End If
End With
TimerInterval = 0
DoCmd.Hourglass False
End If
End Sub
Code:
Sub Search()
AttachST = 0
AttachmentPath = DLookup("txtFilePath3", "tbl_FilePath")
Fname = DLookup("EnquiryRef", "tbl_Enquiry_Details", "QueryID =" & QueryIDNo) & ".rtf"
Search2
If AttachST = 1 Then
Exit Sub
End If
Fname = DLookup("EnquiryRef", "tbl_Enquiry_Details", "QueryID =" & QueryIDNo) & ".txt"
Search2
If AttachST = 1 Then
Exit Sub
End If
Fname = DLookup("EnquiryRef", "tbl_Enquiry_Details", "QueryID =" & QueryIDNo) & ".htm"
Search2
If AttachST = 1 Then
Exit Sub
End If
End Sub
Code:
Sub Search2()
On Error GoTo Search_Err
Dim strPrompt As String, strTitle As String
ChDir AttachmentPath ' Changes directory to new file path
Dim i As Integer
[B] With Application.FileSearch[/B]
.LookIn = AttachmentPath
.FileName = Fname
If .Execute > 0 Then
AttachST = 1
Else
AttachST = 0
Exit Sub
End If
End With
Search_Exit:
Exit Sub
Search_Err:
[B]MsgBox "File Path Not Found (" & Error$ & ")", vbInformation, vbNullString[/B]
Resume Search_Exit
End Sub
Any help highly appreaciated...
Thank you
Last edited: