InputMask problem when Syntax Characters are involved

  • Thread starter LeslieJ via AccessMonster.com
  • Start date
L

LeslieJ via AccessMonster.com

I have a combo box that selects a type of document, and then I have the
following select case code to determine how the doucment number input mask is
shown:

Select Case Me.[Document Type].Value
Case "1"
Me.[Document Number Text Box].InputMask = "SOP 00 000"
Case "2"
Me.[Document Number Text Box].InputMask = "COP 00.000"
Case "8"
Me.[Document Number Text Box].InputMask = "CS00 000W"
Case "28"
Me.[Document Number Text Box].InputMask = "T00 000A"
Case "29"
Me.[Document Number Text Box].InputMask = "T00 000B"
Case "30"
Me.[Document Number Text Box].InputMask = "T00 000T"
Case Else
Me.[Document Number Text Box].InputMask = ""
End Select

My problem is for example, Case 8 - the C does not appear because it is
already a character in the syntax available for creating input masks. I need
it to actually include the letter C as part of the input mask, I don't want
it to mean "entry of any character or space optional."



Any suggestions will be greatly appreciated!
Thank you in advance!
 
W

Wayne-I-M

Really not any idea of what you are trying to do -
but try something like this
"C"&\S00\ 000\W

If this is wrong (proberbly is) can you give an example of what you want the
end result to be
 
L

Linq Adams via AccessMonster.com

To have literal characters appear in an Input Mask you have to use a
backslash in front of it, such as Text0.InputMask = \C\S00 000\W"

To do it in code, like you're doing:

Me.[Document Number Text Box].InputMask = "\C\S" & "00 000" & "\W"

worked when I just tested it.
 
L

LeslieJ via AccessMonster.com

Thank you so much, from your answer I understand what I was doing wrong.

However, now I've come into another problem. When I leave the database and
come back, the formatting from the input mask has disappeared and there are
just five numbers bunched together. Is there a way to constantly show the CS
and the W? I want my database to store the number as CS01 010W for example.

Linq said:
To have literal characters appear in an Input Mask you have to use a
backslash in front of it, such as Text0.InputMask = \C\S00 000\W"

To do it in code, like you're doing:

Me.[Document Number Text Box].InputMask = "\C\S" & "00 000" & "\W"

worked when I just tested it.
 
D

Damon Heron

Since the input mask if for display, why do you need to store it? The
documenttype number is unique to the input mask, correct?
so just store the doctype with the numbers, and you will have all the info
you need.

Damon

LeslieJ via AccessMonster.com said:
Thank you so much, from your answer I understand what I was doing wrong.

However, now I've come into another problem. When I leave the database
and
come back, the formatting from the input mask has disappeared and there
are
just five numbers bunched together. Is there a way to constantly show the
CS
and the W? I want my database to store the number as CS01 010W for
example.

Linq said:
To have literal characters appear in an Input Mask you have to use a
backslash in front of it, such as Text0.InputMask = \C\S00 000\W"

To do it in code, like you're doing:

Me.[Document Number Text Box].InputMask = "\C\S" & "00 000" & "\W"

worked when I just tested it.
 

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

Top