Set value base of 4 digits from middle of number

Magnus1982

Registered User.
Local time
Today, 10:04
Joined
Apr 29, 2017
Messages
41
Hi,

I am looking VBA code to change value one of the form field base on value from other field. But to make it more difficult-

If I will write to Field 1 one of below number :

858055078
986055063
123066046
987066036

then in field 2 I would like to have value deepens from that middle four numbers
Example1
Set Field1 858055078 Fill automatically Field2 Mazda
or
Set Field1 123066046 Fill automatically Field2 Audi

Tnx for help
 
Make a table. (Usu the answer to every thing)
Code,car
0550, Mazda
0660, Audi

Then a query ,qsQ1, would separate the middle as a field:
Mid([field],4,4)
Join this query qsQ1 to the tCodes table to get the car name.
 
What exactly does these mean?
858055078

If this is some sort of code/identifier, then tell us more.
 
It seems your "number" consists of at least three distinct pieces of information. As such I would consider breaking it into three separate fields.

Then you can easily retrieve the make of the car by looking up a table of the translations.

The three parts can be concatenated back together for display as required.
 
first 3 digit are not important at all last two also.
That example is only to show what i am looking. I am not working with car parts or car.

The idea is . When i will scan this number by bar code scanner that for digit should show, what should show up in other field.
I am scanning number and in field1 number show up, in field2 automatic name show up base on this 4 digit. I have only 6 different name to show.

I am working with electronic but make example on this brand of industry will be more confused
 

Users who are viewing this thread

Back
Top Bottom