PC Review


Reply
Thread Tools Rate Thread

Correct syntax in some strPath code?

 
 
=?Utf-8?B?Q1c=?=
Guest
Posts: n/a
 
      7th Dec 2006
I have created a command button on our forms that creates (on first click)
and then subsequently (on later clicks) takes us into a folder on the server
where we can save and then access various documents associated with our
transactions.

At present the new folder name consists of the job Ref and the customer's
Surname. So a typical folder would be named ....\70301Smith.

The line that deals with this is:
strPath = "\\Server1\Docs\" & Me.Ref & Me.Customer1Surname

This is OK and working fine except that we would like to have a space
between the Ref and the Surname, i.e. \70301 Smith, as the name is then
easier to see at glance.

But I can't work out how to force a space, i.e. how the last bit of the
strPath code should be written. I have tried a space, a hyphen, an
underscore, and VB doesn't like any of those.

No doubt this is another of those "easy when you know how" issues ... please
let me into the secret!
Many thanks
CW

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      7th Dec 2006
strPath = """\\Server1\Docs\" & Me.Ref & Me.Customer1Surname & """"

or

strPath = Chr$(34) & "\\Server1\Docs\" & Me.Ref & Me.Customer1Surname &
Chr$(34)

(Watch for word-wrap: the second alternative is also supposed to be on one
line. And just to be explicit, in the first alternative, that's 3 double
quotes at the beginning, and 4 double quotes at the end.)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"CW" <(E-Mail Removed)> wrote in message
news:A043812F-F562-473E-A90A-(E-Mail Removed)...
>I have created a command button on our forms that creates (on first click)
> and then subsequently (on later clicks) takes us into a folder on the
> server
> where we can save and then access various documents associated with our
> transactions.
>
> At present the new folder name consists of the job Ref and the customer's
> Surname. So a typical folder would be named ....\70301Smith.
>
> The line that deals with this is:
> strPath = "\\Server1\Docs\" & Me.Ref & Me.Customer1Surname
>
> This is OK and working fine except that we would like to have a space
> between the Ref and the Surname, i.e. \70301 Smith, as the name is then
> easier to see at glance.
>
> But I can't work out how to force a space, i.e. how the last bit of the
> strPath code should be written. I have tried a space, a hyphen, an
> underscore, and VB doesn't like any of those.
>
> No doubt this is another of those "easy when you know how" issues ...
> please
> let me into the secret!
> Many thanks
> CW
>



 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      7th Dec 2006
Ooops, missed the space!

strPath = """\\Server1\Docs\" & Me.Ref & _
" " & Me.Customer1Surname & """"

or

strPath = Chr$(34) & "\\Server1\Docs\" & _
Me.Ref & " " & Me.Customer1Surname & _
Chr$(34)


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:(E-Mail Removed)...
> strPath = """\\Server1\Docs\" & Me.Ref & Me.Customer1Surname & """"
>
> or
>
> strPath = Chr$(34) & "\\Server1\Docs\" & Me.Ref & Me.Customer1Surname &
> Chr$(34)
>
> (Watch for word-wrap: the second alternative is also supposed to be on one
> line. And just to be explicit, in the first alternative, that's 3 double
> quotes at the beginning, and 4 double quotes at the end.)
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "CW" <(E-Mail Removed)> wrote in message
> news:A043812F-F562-473E-A90A-(E-Mail Removed)...
>>I have created a command button on our forms that creates (on first click)
>> and then subsequently (on later clicks) takes us into a folder on the
>> server
>> where we can save and then access various documents associated with our
>> transactions.
>>
>> At present the new folder name consists of the job Ref and the customer's
>> Surname. So a typical folder would be named ....\70301Smith.
>>
>> The line that deals with this is:
>> strPath = "\\Server1\Docs\" & Me.Ref & Me.Customer1Surname
>>
>> This is OK and working fine except that we would like to have a space
>> between the Ref and the Surname, i.e. \70301 Smith, as the name is then
>> easier to see at glance.
>>
>> But I can't work out how to force a space, i.e. how the last bit of the
>> strPath code should be written. I have tried a space, a hyphen, an
>> underscore, and VB doesn't like any of those.
>>
>> No doubt this is another of those "easy when you know how" issues ...
>> please
>> let me into the secret!
>> Many thanks
>> CW
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct Syntax Dirk Goldgar Microsoft Access Form Coding 4 20th Mar 2007 05:17 PM
What is the correct syntax... Aaron E via AccessMonster.com Microsoft Access Form Coding 2 30th Jul 2005 04:08 PM
Correct syntax Please Dar Microsoft Access VBA Modules 2 11th Oct 2004 06:24 PM
correct syntax mtress Microsoft Access Getting Started 1 14th Sep 2004 06:13 AM
Can't get this syntax correct, please help. Sharlene England Microsoft Excel Programming 4 1st Dec 2003 05:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:29 PM.