Error message with declaring variable as a FileDialog

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Busbait
    New Member
    • Sep 2007
    • 18

    Error message with declaring variable as a FileDialog

    Hi

    I am trying to declare a variable as a FileDialog object in VB for MS Access 2007

    Dim fd As FileDialog

    But, I am receiving an error message “ Compiler error : User-Defined type not defined”

    Can you please help here?
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    You have to set a VBA reference to the Microsoft Office XX.0 Object library.

    I don't know what XX version 2007 is, 2003 is 11.0 for comparision.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32661

      #3
      From the VBA window select :
      Tools / References and search down the list for the appropriate reference.

      Comment

      • Busbait
        New Member
        • Sep 2007
        • 18

        #4
        Thanks .......... it works fine now

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32661

          #5
          Cool. Thanks for letting us know :)

          Comment

          Working...