G
Guest
Howdy folks
Just wonder if I could take a couple moments and pick your brains here
I currently have a query that uses an expression to trim a field value an extract only a portion of the text in the field
Example
Expression here
TRUNPID: Trim(Mid([DESCRIPTION],InStr(1,[DESCRIPTION],"-")+1,InStr(1,[DESCRIPTION],",")-5)
where [DESCRIPTION] is the name of the field I am trimming
Actual DESCRIPTION field values
713-HV1234A, Valve, Han
713-TCV1456, Valve, Temperature Contro
The strings returned from my current expression would be
HV1234
TCV145
Now on to my real problem. Instead of having the HV1234A as one string, I want to be able to break that string into multiple fields, something like this
HV 1234
TCV 145
Is there a way to modify my current expression to handle such a function? I was thinking I could make the expression trigger on the actual alpha-numeric characters instead of the punctuation. Unfortunately I have been unable to find the appropriate wildcards to use as part of the InStr command in place of the punctuation. As you can see I can't use defined breaking points as the strings vary in length, sometimes 2 letters, sometimes 3, etc
My code is very sloppy as I am by no means an expert Access Programmer and I appreciate any help you can provide
Jason
Just wonder if I could take a couple moments and pick your brains here
I currently have a query that uses an expression to trim a field value an extract only a portion of the text in the field
Example
Expression here
TRUNPID: Trim(Mid([DESCRIPTION],InStr(1,[DESCRIPTION],"-")+1,InStr(1,[DESCRIPTION],",")-5)
where [DESCRIPTION] is the name of the field I am trimming
Actual DESCRIPTION field values
713-HV1234A, Valve, Han
713-TCV1456, Valve, Temperature Contro
The strings returned from my current expression would be
HV1234
TCV145
Now on to my real problem. Instead of having the HV1234A as one string, I want to be able to break that string into multiple fields, something like this
HV 1234
TCV 145
Is there a way to modify my current expression to handle such a function? I was thinking I could make the expression trigger on the actual alpha-numeric characters instead of the punctuation. Unfortunately I have been unable to find the appropriate wildcards to use as part of the InStr command in place of the punctuation. As you can see I can't use defined breaking points as the strings vary in length, sometimes 2 letters, sometimes 3, etc
My code is very sloppy as I am by no means an expert Access Programmer and I appreciate any help you can provide
Jason