How to convert/transform txt to DB

Z

zbud

how can I get this type date into Access:

Where the Contact_xxxxx is the field name and the other text the data

Contact_FullName Martha Fuentes
Contact_StreetAddress 185 S. Oleander
Contact_Address2
Contact_City Fellsmere
Contact_State FL
Contact_ZipCode 32948
Contact_WorkPhone
Contact_HomePhone 934-5723-Cathy
Contact_Email
Contact_Work:
Contact_FullName Glenda Fuentes
Contact_StreetAddress 250 S. Magnolia St.
Contact_Address2
Contact_City Fellsmere
Contact_State FL
Contact_ZipCode 32948
Contact_WorkPhone
Contact_HomePhone (7720 571-9999
Contact_Email
Contact_Work: I would appreciate a lap-top for my son.
 
B

BillCo

Here's and idea:

1. Create a temporary table for importing the data with two fields:
fldDescription and fldData. Use the import text wizard to create an
import spec and save it. The import spec could use colons (":") and
tabs as field separaters, depending on how the data is presented in the
text file.

2. Use docmd to transfer text into the temp table and specify the
import spec you saved.

3. Each new line will create a new record in tblTemp with
Contact_XXXXXX as the fldDescription and the fldData as data

4. open a recordset on the temp table and loop through the records,
adding the data to the appropriate field in your actual data table.

5. Delete * from tmpTable when done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top