Using Textbox to change the Position and Length in Mid Function

gatefire08

New member
Local time
Today, 15:31
Joined
Jul 28, 2015
Messages
7
Hello,

I have a .csv file where I need to parse out the information.

I have imported the .csv file into access and all the data is in [Field1]

Instead of using query design, I want to create a user interface [Form] where anyone can input in the textbox the position and length of a mid function.

Example:

Last name: Position = 1 Length =15
First Name: Position = 15 Length = 30

Is it possible for users to input the numbers in texboxes to extract the data to another table?

Thank you in advance.
 
Yes, but why not use the text import wizard provided by Access?
 
Hello,

The reason for this because the length and position of the .csv is not always the same. The LastName length and position would varies from files to files.


Thanks
 
The reason for this because the length and position of the .csv is not always the same.

That is why the user would run the import wizard on each occasion.

At least it provides a visual feedback instead of them having to count characters and hope for the best.
 
Hello,

I made the provided example simple so it would be a little easier to explain myself. haha But in reality, the length of the file is anywhere from 1 to 5000.

and it would look like this

0409809238498AddressCityState120348320948AccountInfo23094LastName


I have the layout for the length and position of each field and I just have to plug in the numbers. So currently, Im using mid function in design view to extract them.

I thought it would more user friendly and less tedious if I have an interface.

Hopefully that clears it up.


and i think Im heading towards the right direction by using Control Source and linked it to textboxes

Thanks again
 
From the query designer you can refer to the control on the form.

Code:
Surname: Mid(field1,Forms!formname.startposition, Forms!formname.thelength)
 

Users who are viewing this thread

Back
Top Bottom