VBA Doubt - Forms

Asked

Viewed 82 times

2

How to format the CPF field in the figure below? inserir a descrição da imagem aqui

Grateful

  • Welcome to Stackoverflow in English. I edited your question to remove the greetings as we usually keep the text as clean as possible to focus on your scheduling question. If you are interested in visiting a part of the site that is not aimed to ask questions can know the [chat]. If you have questions about the operation, rules and procedures of the site visit the [meta] :)

1 answer

4

Entry mask

On the estate InputMask from your textbox, include the mask 000.000.000-00, thus:

seuTextBox.InputMask = "000.000.000-00"

Mask can receive characters:

  • 0 - Digit (0 to 9, mandatory entry, plus [+] and minus [?] signals are not allowed).
  • 9 - Digit or space (non-compulsory input, plus and minus signals are not allowed).
  • # - Digit or space (entry not required; spaces are displayed as whitespace in edit mode, but whitespace will be removed when data is saved; plus and minus signals are allowed).
  • L - Letter (A to Z, mandatory entry).
  • ? - Letter (A to Z, optional entry).
  • To - Letter or digit (mandatory entry).
  • to - Letter or digit (optional input).
  • & - Any character or space (mandatory entry).
  • C - Any character or space (optional input).

See also

For more information, more character options (in addition to those listed above) and to find the full documentation, please visit MSDN page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.