By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,162 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,162 IT Pros & Developers. It's quick & easy.

CStr$ Function in Office 2007

P: n/a
My database, built in Access 2000 but opened in Access 2007 does not
seem to like the function CStr$ (with the dollar sign after), and
gives me an error message. However, if I change the function to CStr
(no dollar sign), I don't get the error message anymore. Does anyone
know why this would happen?
Aug 25 '08 #1
Share this Question
Share on Google+
12 Replies


P: n/a
On Aug 25, 1:22*pm, Icarus <tjmos...@gmail.comwrote:
My database, built in Access 2000 but opened in Access 2007 does not
seem to like the function CStr$ (with the dollar sign after), and
gives me an error message. *However, if I change the function to CStr
(no dollar sign), I don't get the error message anymore. *Does anyone
know why this would happen?
My guess is that it's directly related to a USA national debt of 9
trillion 600 billion dollars.
Aug 25 '08 #2

P: n/a
On Aug 25, 4:29*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
On Aug 25, 1:22*pm, Icarus <tjmos...@gmail.comwrote:
My database, built in Access 2000 but opened in Access 2007 does not
seem to like the function CStr$ (with the dollar sign after), and
gives me an error message. *However, if I change the function to CStr
(no dollar sign), I don't get the error message anymore. *Does anyone
know why this would happen?

My guess is that it's directly related to a USA national debt of 9
trillion 600 billion dollars.
That is strange. I thought it might be a reference library issue, or
maybe a corrupt database. Who knew that the national debt was
imacting my query design!
Aug 25 '08 #3

P: n/a
I'm pretty sure it's CStr€() now. If not it soon will be. The dollar
sign will be used for a new conversion function TwoBit$() which will
convert American dollars to their real value.

On Aug 25, 4:58*pm, Icarus <tjmos...@gmail.comwrote:
On Aug 25, 4:29*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
On Aug 25, 1:22*pm, Icarus <tjmos...@gmail.comwrote:
My database, built in Access 2000 but opened in Access 2007 does not
seem to like the function CStr$ (with the dollar sign after), and
gives me an error message. *However, if I change the function to CStr
(no dollar sign), I don't get the error message anymore. *Does anyone
know why this would happen?
My guess is that it's directly related to a USA national debt of 9
trillion 600 billion dollars.

That is strange. *I thought it might be a reference library issue, or
maybe a corrupt database. *Who knew that the national debt was
imacting my query design!
Aug 25 '08 #4

P: n/a
On Aug 25, 7:15*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
I'm pretty sure it's CStr€() now. If not it soon will be. The dollar
sign will be used for a new conversion function TwoBit$() which will
convert American dollars to their real value.

On Aug 25, 4:58*pm, Icarus <tjmos...@gmail.comwrote:
On Aug 25, 4:29*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
On Aug 25, 1:22*pm, Icarus <tjmos...@gmail.comwrote:
My database, built in Access 2000 but opened in Access 2007 does not
seem to like the function CStr$ (with the dollar sign after), and
gives me an error message. *However, if I change the function to CStr
(no dollar sign), I don't get the error message anymore. *Does anyone
know why this would happen?
My guess is that it's directly related to a USA national debt of 9
trillion 600 billion dollars.
That is strange. *I thought it might be a reference library issue, or
maybe a corrupt database. *Who knew that the national debt was
imacting my query design!
Wonderful.

Does anyone have a CONSTRUCTIVE answer now?
Aug 25 '08 #5

P: n/a
Destructively speaking, I can attest that there is no CStr$ function
in my copy of Access2007/VBA. This is scarcely surprising as
CStr(Expression) returns a string.
My copy of Access2000 is exactly the same. The CStr$ function does not
exist.

If I type
Debug.Print CStr$(3)
the code editor changes the line to
Debug.Print CStr(3)

So? I see you did not actually assert that CStr$ worked swimmingly in
Access 2000. Does it? If so, is Option Explicit set? Is Break On Error
set? Is it running after a On Error Resume Next directive? Can you
post the whole procedure where it is used so that we may paste it into
Access 2000 and examine how it works? Have you installed Service Pack
817 for Access 2000?

On Aug 25, 7:37*pm, Icarus <tjmos...@gmail.comwrote:
Does anyone have a CONSTRUCTIVE answer now?
Aug 26 '08 #6

P: n/a
It is actually part of a query:

TicketNum: CStr$(Trim$([Ticket Number]))
Aug 26 '08 #7

P: n/a
"Icarus" <tj******@gmail.comwrote in message
news:b5**********************************@v16g2000 prc.googlegroups.com...
It is actually part of a query:

TicketNum: CStr$(Trim$([Ticket Number]))
FWIW, in 15 years of developing in Access (v2 onwards) I've *never* used the
$ sign in a VBA function.

Keith.
www.keithwilby.com

Aug 26 '08 #8

P: n/a
On Aug 26, 9:45*am, "Keith Wilby" <h...@there.comwrote:
"Icarus" <tjmos...@gmail.comwrote in message

news:b5**********************************@v16g2000 prc.googlegroups.com...
It is actually part of a query:
TicketNum: CStr$(Trim$([Ticket Number]))

FWIW, in 15 years of developing in Access (v2 onwards) I've *never* used the
$ sign in a VBA function.

Keith.www.keithwilby.com
I'm in total agreement that it is not necessary, I'm just curious what
is special about Office 2007 that would make it stop working, while
previous versions of Access seem to allow it.
Aug 26 '08 #9

P: n/a
"Icarus" <tj******@gmail.comwrote in message
news:38**********************************@b30g2000 prf.googlegroups.com...

<snip>

I must admit I've never even considered it, but having just tried it, it
does work in A2k3. Not a jot of use to you but is news to me :-)

Keith.

Aug 26 '08 #10

P: n/a
On Aug 26, 10:11*am, "Keith Wilby" <h...@there.comwrote:
"Icarus" <tjmos...@gmail.comwrote in message

news:38**********************************@b30g2000 prf.googlegroups.com...

<snip>

I must admit I've never even considered it, but having just tried it, it
does work in A2k3. *Not a jot of use to you but is news to me :-)

Keith.
I just need to update the queries where CStr$ was used to reflect that
it no longer works. Not a big deal.
Aug 26 '08 #11

P: n/a
Check out the Trim$ as well Trim is wot I use, but I'm a lousy typist so why
add extra symbols.

Phil
"Icarus" <tj******@gmail.comwrote in message
news:b5**********************************@v16g2000 prc.googlegroups.com...
It is actually part of a query:

TicketNum: CStr$(Trim$([Ticket Number]))

Aug 26 '08 #12

P: n/a
Sky
"Icarus" <tj******@gmail.comwrote in message
news:b5**********************************@v16g2000 prc.googlegroups.com...
It is actually part of a query:

TicketNum: CStr$(Trim$([Ticket Number]))
In Access 2003, the Trim$() function only accepts strings and returns
string, whereas Trim() will accept a Null and propagate the Null through.
Other functions are similar, such as Left$ and Left, or Right$ and Right.

In a query, Trim() is probably safer unless it is positively known there are
no nulls. Perhaps the $ variations of these string functions are
undetectably faster, if you know there are no nulls.

The string conversion function CStr() does not accept Nulls in Access 2003,
so it seems there is no reason to have CStr$(). Both work, but neither
accepts nulls. Perhaps they removed CStr$ in Access 2007.

- Steve

Sep 4 '08 #13

This discussion thread is closed

Replies have been disabled for this discussion.