[AccessD] Converting case

Heenan, Lambert Lambert.Heenan at aig.com
Thu Feb 27 13:53:57 CST 2014


Yep. That syntax is invalid in Access VBA (Access 2010). Perhaps whoever wrote it was thinking in some other language.

The purpose of the line is to convert x() from a UniCode (i.e. 2 bytes per character) string to an ASCII string. This modification does that...

Dim i As Long
Dim x() As Byte
x = "ABCDEFG"
x = StrConv(x, vbFromUnicode) ' Convert string.

For i = 0 To UBound(x)
    Debug.Print x(i)
Next

And the empty parentheses just declare an array of unknown size. The assignment 

x = "ABCDEFG" 

completes creation of the array.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Benson
Sent: Wednesday, February 26, 2014 5:39 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Converting case

I rarely do this but I decided to look up what MSFT had to say about StrConv function.

I was surprised to see in this post, a second argument in an assignment statement (i.e., equal sign expression). Is that valid?
http://office.microsoft.com/en-us/access-help/strconv-function-HA001228915.aspx
 Furthermore, using () in a byte declaration? I thought that was for variants?

I feel like such a know-nothing!

Dim i As Long

Dim x() As Byte
x = "ABCDEFG", vbFromUnicode ' Convert string.
For i = 0 To UBound(x)
    Debug.Print x(i)
Next



On Wed, Feb 26, 2014 at 1:26 AM, Bob Gajewski <rbgajewski at roadrunner.com>wrote:

> Temp = StrConv(Temp, vbProperCase)
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stephen 
> Bond
> Sent: Wednesday, February 26, 2014 00:59 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Converting case
>
> http://support.microsoft.com/kb/815282
>
> Method 1 looks promising
>
>
> Stephen
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kathryn 
> Bassett
> Sent: Wednesday, 26 February 2014 6:00 p.m.
> To: Stephen
> Subject: [AccessD] Converting case
>
> On to another. Googling gets me some answers for Excel, but not Access.
>
> https://www.dropbox.com/s/c5cg7uji1kkhr0i/ConnerBishopHistoriesPlay.ac
> cdb
>
> In the Histories table, I converted the Country field using Find/Replace.
> But I don't relish the time required to do that with StateProvince, 
> County, and Town. Is there a quick way to change those to first letter 
> upper case, rest lower case?
>
> For instance NOVA SCOTIA to Nova Scotia, SAINT JEAN to Saint Jean, 
> CLARKE COUNTY to Clarke County?
>
> --
> Kathryn Rhinehart Bassett (Pasadena CA) "Genealogy is my bag" "GH is 
> my soap"
> kathryn at bassett.net
> http://bassett.net
>
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



--
*Regards,*


*Bill Benson*
*VBACreations*

PS:  You've gotten this e-mail *because you matter to me!*
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list