Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Field Mapping Form - Suggestions.

Posted on 2010-08-26
7
Medium Priority
?
379 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 1000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

971 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