Solved

Field Mapping Form - Suggestions.

Posted on 2010-08-26
7
365 Views
Last Modified: 2013-11-28
Experts,

I'm looking for a predeveloped form (buy??) or suggestions to build my own...
that will map an input file into predefined table.

My client's application requires uploading a table into an application.  The application will hold the data in a predefined table.  The source data will be either a *.CSV or an .XLS / .XLSX file type.  The input file will not be in the same structure and the predefined table, so it will need to be mapped before importing.

I've seen many mapping applications that show the input data down the left side of the form. and the target file down the right side of the form.

Any thoughts on where I can get such a form or suggestions on building one.

I'm pretty good with VBA.

Thank you!

John

0
Comment
Question by:VenturSum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 40

Expert Comment

by:als315
ID: 33539049
If input and output tables structure is not changing every time when you want to upload data, your can link input file to Access and make query for adding data in output table.
0
 

Author Comment

by:VenturSum
ID: 33539371
The input file is going to change.  It's like a list of customers and sometimes the first name is "FName" and sometimes it's "first name" and sometimes it "FirstName".  So I need to build a mapping module / form.  I built the vba to get the names of the rows / headers.

But I'd like to see if there is some prebuilt code so I don't have to re-invent it.

0
 
LVL 40

Expert Comment

by:als315
ID: 33539617
It is very simple change first string of excel file if columns order is same.
All ready programs with this functionality, which I ever seen use fixed internal data structure and it can't be changed
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:VenturSum
ID: 33540658
ALS, thank you for your help...


I've seen many internet applications where before I upload a file; I have to map the file I'm going to upload to the preexisting data table.  The fields of the import table are on the right, and the fields of the preexisting table are on the left.  --- this is what I need to build in Access or buy.

The clients import table will always be changing
I have no opportunity to reorganize it prior to importing it into to Access.

0
 
LVL 40

Expert Comment

by:als315
ID: 33541225
It is same to my experience - "left side" is fixed. It is difficult to find ready application with your "left side".

You can build same form - left side is your fixed fields.
You can select file, link it (you can use file extension for link type), get columns names, build list from this names and use this list for "right side". For every your field user should select from list with column names from linked file.
Then you can create SQL string with selected field relations and run it.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 250 total points
ID: 33542022
As a start create a table (tblMapFields) with a field for the Fixed Names and a cloumn with the "Potential" Alternate names.
This way at some point you could use dlookup to find the corresponding Field Name.

Obviously you will need code to read in the Source Field Names
So I would first use standard code to import the data to a temp Access table first.
Import CSV:
DoCmd.TransferText acImportDelim, "YourImportSpecName", "TargetNewTableName", "C:\YourFolder\YourFile.csv", True

Import Excel:
DoCmd.TransferSpreadsheet acImport, , "TargetNewTableName", "C:\YourFolder\YourFile.XLS", True

You can use a DAO loop through the table field Names:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23910064.html

Now you create a form with tblMapFields and fill in the Source Field names

Now you can use dlookup to get the target filed name based on the source field Name
Dlookup("TargetFieldName","tblMapFields","SourceFieldName=" & "'" & Me.SourceFieldName & "'")

I am sure you are getting the idea here:
Create a Mapping Table
Set the mappings in this table
Import the file
Use Dlookup to find the Mapped field name form the imported File
...

;-)

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 33553314
;-)

Jeff
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question