Compile error: user-defined type not defined (1 Viewer)

msaccesspatc

Registered User.
Local time
Today, 14:25
Joined
Aug 26, 2012
Messages
12
It's likely most anyone can help with this. I know very little but need to debug form/module. I have a form written by another person that converts a pipe '|' file to tab delimited. When i execute there's an error of 'Compile error: user-defined type not defined.

It highlights the 3rd line below shown here in red

Option Compare Database
Option Explicit
Public objFSO As New FileSystemObject
Public Function ConvertFile(tcFileIn As String, tcFileOut As String)


In reading some threads, it says that i need to remove the reference in tools>references, then apply (check off) the correct references. I have no idea which reference that would be to correct this compile error. OR,, maybe a change in reference is not the way to go. Just need a resolution to the error message received.

any help is much appreciated in trying to increase my access knowledge.

thanks
msaccesspatc
 

Rx_

Nothing In Moderation
Local time
Today, 12:25
Joined
Oct 22, 2009
Messages
2,803
Basically, this object type is not included in the VBA objects. So, a Reference to the object Library must be set. If you were for example referencing MS Word Document, you would have to set a Reference to MS Word objects.
Maybe this will get you started:

Within Excel / Access you need to set a reference to the VB script run-time library. The relevant file is usually located at \Windows\System32\scrrun.dll
  • To reference this file, load the Visual Basic Editor (ALT-F11)
  • Select Tools - References from the drop-down menu
  • A listbox of available references will be displayed
  • Tick the check-box next to 'Microsoft Scripting Runtime'
  • The full name and path of the scrrun.dll file will be displayed below the listbox
  • Click on the OK button
http://msdn.microsoft.com/en-us/library/2z9ffy99(v=VS.85).aspx
 

Users who are viewing this thread

Top Bottom