Remove spaces in the middle of a text value entered

E

emerlita

This is my input mask.... >LLL####LL.LL

And this is what i get in the datasheet view .... MGW1___HT.OK

Instead, i want to have this .... MGW1HT.OK or MGW12HT.OK or
MGW123HT.OK.

Can someone help me please?

E
 
F

fredg

This is my input mask.... >LLL####LL.LL

And this is what i get in the datasheet view .... MGW1___HT.OK

Instead, i want to have this .... MGW1HT.OK or MGW12HT.OK or
MGW123HT.OK.

Can someone help me please?

E

So why are you using an Input Mask if it doesn't do what you want?

If you are just looking to get all Upper Case characters with no
spaces, let the user enter the data however the wish, in upper or
lower case, with or without spaces.

Then code the control's AfterUpdate event:

Me![ControlName] = Replace(UCase([ControlName]), " ", "")
 
J

John Nurick

Input masks can't handle that sort of variable pattern.

Instead, use an input mask ofto convert everything to upper case, and a validation rule to check the
pattern. Something like this should do:

LIKE "[A-Z][A-Z][A-Z]###[A-Z][A-Z].[A-Z][A-Z]" OR
LIKE "[A-Z][A-Z][A-Z]##[A-Z][A-Z].[A-Z][A-Z]" OR
LIKE "[A-Z][A-Z][A-Z]#[A-Z][A-Z].[A-Z][A-Z]" OR IS NULL

Omit
OR IS NULL
if you don't want to allow the field to be left blank.
 
E

emerlita

Input masks can't handle that sort of variable pattern.

Instead, use an input mask ofto convert everything to upper case, and a validation rule to check the
pattern. Something like this should do:

LIKE "[A-Z][A-Z][A-Z]###[A-Z][A-Z].[A-Z][A-Z]" OR
LIKE "[A-Z][A-Z][A-Z]##[A-Z][A-Z].[A-Z][A-Z]" OR
LIKE "[A-Z][A-Z][A-Z]#[A-Z][A-Z].[A-Z][A-Z]" OR IS NULL

Omit
OR IS NULL
if you don't want to allow the field to be left blank.

This is my input mask.... >LLL####LL.LL
And this is what i get in the datasheet view .... MGW1___HT.OK
Instead, i want to have this .... MGW1HT.OK or MGW12HT.OK or
MGW123HT.OK.
Can someone help me please?

Thank you all!!!
 
Top