Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access External data > Runtime error 3...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 10831 of 11313
Post > Topic >>

Runtime error 31519

by =?Utf-8?B?Sm9obiBL?= <JohnK@[EMAIL PROTECTED] > Jul 24, 2008 at 10:44 AM

I tried the code here:  http://www.mvps.org/access/api/api0001.htm
to open 
file dialog so the user can im****t the txt files they select.

The code I have follows (I used the code from his TestIt function and
added 
to that:

Private Sub Command0_Click()
    Dim strFilter As String
    Dim lngFlags As Long
    'strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda,
*.mdb)", _
                    "*.MDA;*.MDB")
    'strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)",
"*.DBF")
    strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
    'strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
    MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
        Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
        DialogTitle:="Hello! Open Me!")
    ' Since you passed in a variable for lngFlags,
    ' the function places the output flags value in the variable.
    Debug.Print Hex(lngFlags)
    
    DoCmd.TransferText acIm****tFixed, FileIm****tSpec, tblIm****t, strFilter

Everything stops on the transfer text part and says error 31519 can't
im****t 
that type of file.  I can right click in the database window and im****t
the 
files from there using the specs named above.  It does not im****t
correctly 
if I try a macro either.  I don't get the same error it just does not
im****t 
all the data, it dumps it off into an error table.  Is there another
setting 
in the file specs setup that I may have missed?  I have been fiddling with

this for 2 hours now.  Kinda stuck...

Thanks,
John
 




 3 Posts in Topic:
Runtime error 31519
=?Utf-8?B?Sm9obiBL?= <  2008-07-24 10:44:00 
RE: Runtime error 31519
=?Utf-8?B?Sm9obiBL?= <  2008-07-24 11:13:04 
RE: Runtime error 31519
=?Utf-8?B?Sm9obiBL?= <  2008-07-24 11:31:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 17:53:27 CST 2008.