PC Review


Reply
Thread Tools Rate Thread

Need help with code issue.

 
 
Allen Browne
Guest
Posts: n/a
 
      27th Jun 2006
It was probably the quotes that fixed the problem.

The Nz() supplies a value to use for null.
Otherwise the SQL statement would not be correct if the text box had no
value.
For example, instead of reading:
SET Month_End_Total = 0 WHERE ...
it would not work if the text box was blank and so the SQL statement became:
SET Month_End_Total = WHERE ...

That issue is #2 in this article:
Common Errors with Null
at:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"C_Ascheman" <(E-Mail Removed)> wrote in message
news:7A173100-22C5-4B23-81B3-(E-Mail Removed)...
> Thank you so very very much Allen. You are a godsend. That worked
> perfectly.
> Now maybe I can sleep a little better tonight. If you could do me one more
> favor please I would be very greatful. Can you explain to me why what I
> did
> wasn't working. In your code you have "SET Month_End_Total = " & Nz ...
> what
> is the Nz for. Thats the first time I have ever seen that in any code. I
> now
> see though where I needed to put the ", and how to place them. Once more
> thank you so very much.



 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      27th Jun 2006
=?Utf-8?B?Q19Bc2NoZW1hbg==?= <(E-Mail Removed)> wrote
in news:7A173100-22C5-4B23-81B3-(E-Mail Removed):

> . Can you explain to me why what I did
> wasn't working.


What was suggested:

> """" & "o CDM 03/2006" & """"


What you coded:

"WHERE Month_End_Date =" ""& _
strValue & Format([Date], "mm/yyyy")""

.... which can't be right becuase it wouldn't get past the editor. The
trick is that in order to put quote(") marks inside strings, you have to
double them: that is why

""""

is a string containing one quote char; and

"WHERE Month_End_Date = """ & stuff & """"

has one quote char at each end of the stuff, which is what you want.


Hope that makes it a bit clearer.
All the best


Tim F

 
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
Need help with code, but code file is quite huge Andy B Microsoft VB .NET 0 7th Jun 2008 01:08 AM
[New] Zipoid - ZIP Code, City Name and Area Code Lookup - Zip Code to Zip Code Distance Calculation Mel Freeware 0 22nd Jul 2005 04:13 PM
HELP NEEDED FAST!!! HELP HELP HELP HELP HELP HELP FAST HELP NEEDED Jonathan Windows XP General 10 13th Jan 2005 03:22 AM
Need help converting C# code to VB.NET code... Unforgiven Microsoft VB .NET 5 9th Sep 2004 05:32 PM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 AM.