Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2011, 10:51 PM
Registered User
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Importing Text into Access using VBA

Good Morning/Afternoon/Evening,

I am currently working on a solution for auto importing text files into access. Currently I am doing the data entry by hand, however given the volume of data entry I have to do, this is conflicting with other responsibilities. I have some experience with BASIC (just getting started with VB) though it's been a few years since I've done anything. I'm not necessarily asking for anyone to write the code for me, mostly just need a nudge in the right direction =)

The files I am working with are delimited, however not in a typical row/column structure, and include a multi line header. I do want some data from the header, but that isn't high priority for me. The rest of the file is structured in the following way:
Each line is delimited, the first field indicates which table the information belongs in. Each line is ended with a double delimiter.
The first line includes identifying information (as an example we'll say customer ID and order ID). All subsequent tables are related back to the customer ID and order ID tables.

The file would basically look like this:

[Header]
[Header]
[Header]
Order,Bob22,May,12345,,
Product,stringcheese,27,$1.99,,
Product,calendar,1,$5.99,,
Service,extendedwarranty,1year,$20.00,,
Service,24hourtechsupport,1year,$30.00,,
Shipto,12345 Q St.,Somewhere,NY,14141,,
End,,

The fields above just signify the formatting being used. I am mainly unsure how to send each line to it's respective table and ensure it is linked back to the Customer and Order tables.

An example table would be the product table:

Item - Quanitity - Price - Customer ID - Order ID

Any help would be greatly appreciated.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Link a text file to Access using VBA wscheiman Access VBA 1 June 30th, 2013 07:02 PM
Access VBA - Controlling Text boxes in a form Scripts82 Access VBA 4 February 8th, 2006 08:35 PM
Text File-Newbie VBA Access mbeirn Access VBA 1 October 6th, 2005 07:18 AM
VBA access List data to text file Data-Base Access VBA 6 September 15th, 2005 04:04 PM
Importing text data to an access table sbyers_1982 VBScript 4 November 29th, 2004 01:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.