Access 2003 Runtime Error 31519
Contents |
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of runtime error 31519 you cannot import this file ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated
Docmd.transfertext Acimportdelim
SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. Microsoft: Access Modules (VBA Coding) Forum at Tek-Tips HomeForumsProgrammersDBMS PackagesMicrosoft: Access Modules (VBA Coding) Forum Error 31519. You cannot import this file 2 thread705-1707216 Forum Search FAQs Links MVPs Error 31519. You cannot import this file Error 31519. You cannot import this file vba317 (Programmer) (OP) 25 Mar 13 12:25 I am using access 2003. I am trying to import a file and I keep on getting the error 31519. You cannot import this file. I have tested the mask called IMP_CA_Worx and the mask is working. To do the manual import I had to change the file to a text file. I copied and pasted the file name to verify I was not typing incorrectly. The name of the file is VRA03061(Gragil)_AL.C01. The file is being passed to the procedure without a problem. I have highlighted in blue where the error is. Any help would be appreciated. Tom CODEPrivate Sub cmdImp_Click() Dim strFile As String Dim boolWorx As Boolean 'On Error GoTo Err_Imp DoCmd.SetWarnings False ' Get File Name Me.txtFile.SetFocus strFile = "\\server\xfer\caf\" & (Trim(Me.txtFile.Text)) Me.chkWorx.SetFocus If (Me.chkWorx.Value = -1) Then boolWorx = True Else boolWorx = False End If ' Process File With DoCmd .OpenQuery "qry_del_ImpTbl" .OpenQuery "qry_del_ProcTbl" End With If (boolWorx =
Custom Search UtterAccess Forums>Microsoft® Access>Access Modules Error importing data... Forum HomeSearchHelpUA Messages|-- UtterAccess.com NewsAccess Knowledge Center|-- Access Code Archive|-- Access Knowledgebase / FAQ|-- Access TutorialsMicrosoft® Access|-- Local Access User Groups (AUGs)|-- Interface Design|-- Access Q and A|-- Access Tables + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- http://www.tek-tips.com/viewthread.cfm?qid=1707216 Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access Built-in Functions|-- Access Searching + Data Mining|-- Access Records|-- Access Security|-- Access Automation|-- Access Database Container|-- Tool bars, Menu bars + Ribbon|-- Access Services (Web Databases)|-- Access http://www.utteraccess.com/forum/Error-importing-data-t1393466.html Data Access Pages (Deprecated)|-- Access Data Projects - ADP|-- Access Runtime, Packaging & DeploymentAnd More...|-- Microsoft SQL Server|-- SQL Server Reporting Services|-- Microsoft SharePoint|-- Microsoft Internet Explorer|-- Visual Basic 6 and Earlier|-- Visual Basic 2003 and Later|-- ASP and VBScript|-- Web Development|-- PHP, Perl, MySQL and Postgres|-- Other Database Engines|-- BI Tools and Applications|-- JAVA and C#|-- GraphicsMicrosoft® Office|-- Microsoft Excel|-- Microsoft Excel FAQs|-- Microsoft Word|-- Microsoft Outlook|-- Microsoft PowerPoint|-- Microsoft FrontPage/Exp. Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Q & A - UtterAccess.com Forums|-- Q & A - Access Wiki Options j
question and get tips & solutions from a community of 418,417 IT Pros & Developers. It's quick & easy. Runtime Error 31519 P: 4 scruffy https://bytes.com/topic/access/answers/924366-runtime-error-31519-a Hello All, I found some code online (from ADezii -- thanks) to import a .txt file into Access using a Dialog box. When I try and run the code, I am getting the runtime error '31519': You cannot import this file. (**Mod Edit Error occurs on line #22 **) How can I get rid of this error? Any help is appreciated. Thanks! The following is what runtime error I have: Expand|Select|Wrap|Line Numbers PrivateSubCommand43_Click() DimfDialogAsOffice.FileDialog DimvarFileAsVariant DoCmd.SetWarningsFalse 'SetuptheFileDialog SetfDialog=Application.FileDialog(msoFileDialogFilePicker) WithfDialog .AllowMultiSelect=False .Title="SelectaTextFiletoImport" .InitialFileName="C:\*.txt" 'ClearoutanyFilters,thenAddyouown(1) .Filters.Add"TextFiles","*.TXT" 'ShowtheDialog.IftheShowMethodreturnsTrue,theUserpicked 'atleast1File,otherwisetheUserclickedCancel If.ShowThen ForEachvarFileIn.SelectedItems 'Therewillbeonly1Fileselected,soplacetheproperArgumentsintotheTransferTextMethod DoCmd.TransferTextacImportFixed,"ImportB","B",0 Next Else'NothingselectedinFileDialog EndIf EndWith DoCmd.SetWarningsTrue EndSub Nov 22 '11 #1 Post Reply Share this Question 7 Replies Expert Mod 15k+ P: 29,922 NeoPa You provided a FileName parameter of 0. You can't expect it to work with that information runtime error 31519 ;-) Nov 22 '11 #2 reply P: 4 scruffy Thank you! I am new at VBA. How do I enter a file name argument that still allows the user to select the text file? Nov 23 '11 #3 reply Expert Mod 15k+ P: 29,922 NeoPa Scruffy, you need to consider your posts more carefully before submitting them. If your question makes sense to you I expect it's because you already know what you mean. Without any context or reference point that last bit makes no sense to me at all. 'Allowing the user to select the text file' is not any part of the question I've seen so far. Nought for two isn't a good average ;-) Nov 23 '11 #4 reply P: 4 scruffy My goal is to be able to import files using the Dialog box. The filename parameter is the path to the exact file, right? So what should the filename parameter be so that I can still choose the file I want to import? Nov 23 '11 #5 reply Expert Mod 15k+ P: 29,922 NeoPa So, you're really asking here how to use the return value of the FileDialog object you're