Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / February 2006

Tip: Looking for answers? Try searching our database.

Formulat help please

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tanya - 20 Feb 2006 00:06 GMT
Hi,

this works below for a numeric value but not for a text value. (Region is
text)

could someone please help with my syntax?

thanks

  Dim curSum As Currency
  curSum = Nz(DSum("[Total]", "[WIP_Report_Initial_b]", " 'Region' = " & Me.
State), 0)
  Me.txtOrderTotal = curSum
Douglas J. Steele - 20 Feb 2006 00:17 GMT
You need to put quotes around the value if it's text:

 curSum = Nz(DSum("[Total]", "[WIP_Report_Initial_b]", "Region = '" &
Me.State & "'"), 0)

or

 curSum = Nz(DSum("[Total]", "[WIP_Report_Initial_b]", "Region = " &
Chr$(34) & Me.State & Chr$(34)), 0)

(BTW, there's no reason for the single quote around the field name)

Signature

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

> Hi,
>
[quoted text clipped - 10 lines]
> State), 0)
>   Me.txtOrderTotal = curSum
Ricky Hicks [MVP] - 20 Feb 2006 00:21 GMT
Try .....

curSum = Nz(DSum("[Total]", "[WIP_Report_Initial_b]", "Region = '" &
Me.State & "'"), 0)

Signature

Ricky Hicks - Access MVP

> Hi,
>
[quoted text clipped - 10 lines]
> State), 0)
>   Me.txtOrderTotal = curSum
Tanya - 20 Feb 2006 00:53 GMT
Thanks that got it working.

>Try .....
>
[quoted text clipped - 6 lines]
>> State), 0)
>>   Me.txtOrderTotal = curSum
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.