Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application.FileSearch

Status
Not open for further replies.

NSNewey

Programmer
Jun 29, 2005
125
GB
Hi,
I am trying to use Application.FileSearch in visual studio for vb6.
I pasted some code that works in Access but it wont run in VB.
code:
Set fs = Application.FileSearch
With fs
some code here
End With

When I run program, I get Compile Error - Variable not defined and "Application" is highlighted as the error
I have checked the reference to VB Extensibility 5.3 in the project references but is there another one I should tick?

Please help!!!!!!!
 
Hi NSNewey,

VB[red]A[/red] is VB for [red]A[/red]pplications. It runs inside a parent application and can use the objects of that application (in your case, Access)

VB6 programs, on the other hand, run stand-alone - they do not have a parent application and there are no application objects for you to use.

If you have questions about VB you might like to try the Visual Basic (Microsoft) Versions 5 & 6 Forum

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Thanks Tony,

I have now solved the problem using...

Dim fso As New FileSystemObject
If fso.FileExists(myFile) Then
etc etc

Thanks for the insite anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top