SQL to take string from a form WITHOUT converting it

R

rocketD

Hello,

I have a text box on a form that is set to ask the user if he/she
wants to add a new value when they enter something that is not on the
list. If they press ok, then the value is put into the source table.
However, I can't figure out a function to use so that the string is
NOT converted to Upper, Lower, or Proper case. For example, if
someone types in "UNM Vice President's Office", that's what I want - I
don't want it to convert the text to Unm Vice Presiden'ts Office,
which is does. I don't want all Uppercase either - these are going to
be used to Mail Merge eventually, so the formatting needs to be
retained.

This is the current SQL code:

strSQL = "INSERT INTO lkpOrganization(organization) VALUES("""
strSQL = strSQL & StrConv(NewData, 3) & """);"
CurrentDb.Execute strSQL

I've tried using Trim instead of StrConv but it automatically converts
to proper case too. Is what I want possible?
Thanks,
Dara
 
T

Tom van Stiphout

On Wed, 18 Nov 2009 15:04:30 -0800 (PST), rocketD <[email protected]>
wrote:

There is no need to use StrConv if you don't want any conversion:
strSQL = strSQL & NewData & """);"

-Tom.
Microsoft Access MVP
 
R

rocketD

There is no need to use StrConv if you don't want any conversion:
strSQL = strSQL & NewData & """);"

-Tom.
Microsoft Access MVP








- Show quoted text -

Thank you! I just don't know VBA, so I stumble through things without
understanding the obvious. This solves it perfectly.

Dara
 

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