Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2006, 09:04 AM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table Index Problem

I have a column in a table, where I need to be able to differentiate between uppercase and lowercase without getting a duplicate error message.

The table has only two columns.

The first must be a text value, represents the primary key, and is only one character in length. It must support lowercase and uppercase, recognizing them as different values, where "z"<>"Z". What MS Access solution is there to this?

Please help with a solution!!!

 
Old March 17th, 2006, 12:23 PM
Authorized User
 
Join Date: Apr 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The only way I know to force VBA to see the difference between "z" and "Z" is to look at the ascii value of each character. The way you look at the ascii value of a character is to use the asc method as seen below:

asc("z")
asc("Z")

If you need to use an if statement to compare the "z" and "Z" then try this:

If (asc("z") <> asc("Z")) then
    blah, blah, blah
End If

Another option is to store only the ascii values in your table, then you will have numbers to compare and when you need to see what character that ascii number is you just use the chr method as seen below.

Dim strCharacter as String
strCharacter = chr(122)

122 is a lower case z and 90 is an uppercase Z.

donrafeal






Similar Threads
Thread Thread Starter Forum Replies Last Post
index by table in pl/sql vipin1982 All Other Wrox Books 1 October 1st, 2008 12:19 PM
Retrieve Index Status of a table muralidharan.d SQL Server 2005 1 June 6th, 2008 04:13 PM
'AOIndex' is not an index in this table junedali10 Access 1 April 12th, 2008 05:25 PM
more than one index on a table madhukp SQL Server ASP 3 September 11th, 2004 05:46 AM
Index On Table In VB6 p2pbal SQL Server ASP 1 September 3rd, 2004 05:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.