View Full Version : Text Box with custom size


adi32
09-02-2004, 04:52 AM
i have a field like this
W12,5 D100
W2,5 D100
i want to be visible the left size before the D100
ex W12,5
W2,5
how can i do that ?

RichO
09-02-2004, 08:46 PM
Is there simply a space separating the 2 sections?

You could show just the characters to the left of the space with:

Left$([MyField], InStr([MyField], " ") -1)

adi32
09-03-2004, 01:44 AM
Thank you very much it works but I saw that I have and some records like
W7,4 without space after the number and this returns #error

Ex
W7,4 D12 gives W7,4
W7,42 D51 gives W7,42
W7,4 gives #error

I don’t know if this can be fixed

THANK YOU

RichO
09-03-2004, 08:11 AM
For records that have no space, try something like this

Left$([MyField], InStr([MyField] & " ", " ") -1)

This should fix the error problem.

adi32
09-06-2004, 02:21 AM
U R God
Thank You

Pat Hartman
09-06-2004, 08:27 PM
In the future you might consider not using a single field to hold two pieces of data. Properly normalizing your tables will eliminate little problems like this.