Remove spaces in the middle of a text value entered

  • Thread starter Thread starter emerlita
  • Start date Start date
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
 
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]), " ", "")
 
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.
 
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!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top