Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Access Newsgroups
Access VBA Modules
Loading Text file to Access Database
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="drpkrupa, post: 2130820"] I have page with one button. If user click on the import button. I would like to open the file dialog box. User select the text file and click ok then i would like to transfer the data from text file to access table. I wrote code which will open file dialog box and user can select text file. Can anyone help me out how to read the text file and load the data into access table. Code for File dialog box. Dim fDialog As Office.FileDialog Dim vardirectory As String vardirectory = "C:\Documents and Settings\user\Desktop\ Dim varFile As Variant Set fDialog = Application.FileDialog(msoFileDialogFilePicker) With fDialog AllowMultiSelect = True Title = "Please select one or more files" Filters.Clear Filters.Add "Text Files", "*.txt" InitialFileName = vardirectory If .Show = True Then For Each varFile In .SelectedItems MsgBox varFile Next Else MsgBox "You clicked Cancel in the file dialog box." End If End With [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Access Newsgroups
Access VBA Modules
Loading Text file to Access Database
Top