Results 1 to 5 of 5
  1. #1
    ducecoop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    41

    Cleaning up the alphabet

    So I am trying to generate usernames and have some restrictions on what characters are used.
    So I started by cleaning spaces, hyphens, and nyaas, and released I could run up against a whole lot of “accented” characters (Dealing with mostly Hispanic names but I want to cover all the bases)
    So this is what I have so far that works



    Code:
    Me.ComputerUser = LCase(Left([FirstName], 1)) & "" & LCase(Replace(Replace(Replace([LastName], "-", ""), " ", ""), "ñ", "n"))
    But is there any way to code any letter with any accent to be replaced by just the letter without the accent.

    Tia

    Dave
    Last edited by ducecoop; 10-28-2010 at 08:34 AM.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    have you got the list of character codes? that might help to get the actual code of the accent, but not sure:

    for instance, these are the codes:

    Code:
    cindex	ccode
    2	
    3	
    4	
    5	
    6	
    7	
    8	
    11	
    12	
    13	LINEFEED
    14	
    15	
    16	
    17	
    18	
    19	
    20	
    21	
    22	
    23	
    24	
    25	
    26	
    27	
    32	SPACE
    33	!
    34	""""
    35	#
    36	$
    37	%
    38	&
    39	'
    40	(
    41	)
    42	*
    43	+
    44	,
    45	-
    46	.
    47	/
    48	0
    49	1
    50	2
    51	3
    52	4
    53	5
    54	6
    55	7
    56	8
    57	9
    58	:
    59	;
    60	<
    61	=
    62	>
    63	?
    64	@
    65	A
    66	B
    67	C
    68	D
    69	E
    70	F
    71	G
    72	H
    73	I
    74	J
    75	K
    76	L
    77	M
    78	N
    79	O
    80	P
    81	Q
    82	R
    83	S
    84	T
    85	U
    86	V
    87	W
    88	X
    89	Y
    90	Z
    91	[
    92	\
    93	]
    94	^
    95	_
    96	`
    97	a
    98	b
    99	c
    100	d
    101	e
    102	f
    103	g
    104	h
    105	i
    106	j
    107	k
    108	l
    109	m
    110	n
    111	o
    112	p
    113	q
    114	r
    115	s
    116	t
    117	u
    118	v
    119	w
    120	x
    121	y
    122	z
    123	{
    124	|
    125	}
    126	~
    128	€
    130	‚
    131	ƒ
    132	„
    133	…
    134	†
    135	‡
    136	ˆ
    137	‰
    138	Š
    139	‹
    140	Œ
    142	Ž
    145	‘
    146	’
    147	“
    148	”
    149	•
    150	–
    151	—
    152	˜
    153	™
    154	š
    155	›
    156	œ
    158	ž
    159	Ÿ
    161	¡
    162	¢
    163	£
    164	¤
    165	¥
    166	¦
    167	§
    168	¨
    169	©
    170	ª
    171	«
    172	¬
    173	*
    174	®
    175	¯
    176	°
    177	±
    178	²
    179	³
    180	´
    181	µ
    182	¶
    183	·
    184	¸
    185	¹
    186	º
    187	»
    188	¼
    189	½
    190	¾
    191	¿
    192	À
    193	Á
    194	Â
    195	Ã
    196	Ä
    197	Å
    198	Æ
    199	Ç
    200	È
    201	É
    202	Ê
    203	Ë
    204	Ì
    205	Í
    206	Î
    207	Ï
    208	Ð
    209	Ñ
    210	Ò
    211	Ó
    212	Ô
    213	Õ
    214	Ö
    215	×
    216	Ø
    217	Ù
    218	Ú
    219	Û
    220	Ü
    221	Ý
    222	Þ
    223	ß
    224	à
    225	á
    226	â
    227	ã
    228	ä
    229	å
    230	æ
    231	ç
    232	è
    233	é
    234	ê
    235	ë
    236	ì
    237	í
    238	î
    239	ï
    240	ð
    241	ñ
    242	ò
    243	ó
    244	ô
    245	õ
    246	ö
    247	÷
    248	ø
    249	ù
    250	ú
    251	û
    252	ü
    253	ý
    254	þ
    255	ÿ
    could you maybe use a replace function and the chr() function to substitute zero-length strings in for them? Looks like 145/146 are the accents.

    (sorry about posting that long table. I just wanted to see what it would look like.

  3. #3
    ducecoop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    41
    I am guessing I did not explain my needs so good. (I assume smarter people then my can read my mind )

    If a persons name is elaña
    I want to change it to elana

    I replaced the ñ with a n

    My code above already does that.

    But I could in counter many other examples of "non American alphabet" names

    I could code every example I can think of as I have above but I was hoping (Reaching) there may be a way to code ANY letter with an accent of ANY type to be replaced with just the letter.
    I know it is a long shot.

    I have seen PHP code that will just discard letters with accents but that is not what I want either.

    My guess is my code above covers 99.99 % of my potential name issues (and most probably no one using the app will know how to keyboard anything else) but just wondering if anyone had any ideas.

    No deal breaker if I can't get beyond it

    Thanks

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I'm doubting you can. Characters are recognized as is, so treating that squiggly line on top of a letter as if it were a separate element is pretty much impossible.

  5. #5
    ducecoop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    41
    Thanks - as I thought it might be

    Dave

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Alphabet break in report
    By amccook in forum Reports
    Replies: 8
    Last Post: 08-27-2010, 03:13 PM
  2. Cleaning Data
    By Sck in forum Queries
    Replies: 1
    Last Post: 07-22-2010, 12:43 AM
  3. Cleaning Up Data - Need Help
    By NeedHelp in forum Access
    Replies: 2
    Last Post: 06-05-2010, 10:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums