ascii values

  • Thread starter Thread starter richaluft
  • Start date Start date
R

richaluft

I'm wondering if someone can suggest an efficient way to code the
following:
When entering a person's name in a field, I want it to be intered as
surname,prename (without a space after the comma.
Sometimes I have the add a name such as "Brown,Rose A". (Note that I
don't want to bother putting in a separate control for 'middle
initial).

I currently have code that flags a space, Chr(32), in the name to
alert the user not to leave a space. I would like to change this so
that I will only get this message of alert when the space follows a
comma, Chr(44).
Any help as to how to express this would be greatly appreciated.
Richard
 
Using multiple values in a field is against relational normalization rules.
Build 3 separate fields for each name.
 
Using multiple values in a field is against relational normalization rules.
Build 3 separate fields for each name.

Arvin:
Actually, the field that I am using is not part of the normalization
of the Db. It represents a convenient name lookup on a form, where
the field shows the concatenated "surname,prename and date of birth of
the clients, taken from TblClients (on which prename & surname are
separate fields). However, as many people have hyphenated first or
last names, the Db is not constructed with a midinit field. It becomes
just as simple for me to put first name & midinit in a single control,
without having to change tables and forms in multiple places, and
without disturbing the Db normalization.
Richard
 
Have you tried using the Replace() function?

TextBoxName = Replace(TextBoxName, strOldString, strNewString)

where TextBoxName = the text box name
strOldString = ", " (comma space)
strNewString = "," (comma)


HTH
 
Back
Top