Connecting Tech Pros Worldwide Forums | Help | Site Map

Internal Error

Member
 
Join Date: Jul 2007
Posts: 41
#1: Jul 10 '07
I was trying to use the code provided at http://www.mvps.org/access/api/api0001.htm to create a Save As dialog box. However, when i tried to run it, I got an "internal error" and the line Dim OFN As tagOPENFILENAME in the module was highlighted. I just pasted the code as-is. Any ideas?

missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#2: Jul 11 '07

re: Internal Error


APIs aren't really my thing, but this code appears to be very old (Copyrighted 1996) what version of Access are you using and what OS?

Linq ;0)>
Expert
 
Join Date: Jun 2007
Location: Derbyshire, UK
Posts: 347
#3: Jul 11 '07

re: Internal Error


Quote:

Originally Posted by missinglinq

APIs aren't really my thing, but this code appears to be very old (Copyrighted 1996) what version of Access are you using and what OS?

Linq ;0)>

Hi

You could always use the FileDialog object, something like this

Expand|Select|Wrap|Line Numbers
  1. Function SelectedFile() As String
  2.     Dim fDialog As FileDialog
  3.  
  4.     Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
  5.     With fDialog
  6.         If .Show = 0 Then
  7.             SelectedFile = ""
  8.         Else
  9.             SelectedFile = .SelectedItems(1)
  10.         End If
  11.         MsgBox SelectedFile
  12.     End With
  13.  
  14. End Function
  15.  
??

You need a referance the Microsoft Office Object Library.

MTB
Reply