If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Formulat help please
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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200602/1 |
#2
|
|||
|
|||
Formulat help please
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) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Tanya via AccessMonster.com" u15820@uwe wrote in message news:5c22baaab99c0@uwe... 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200602/1 |
#3
|
|||
|
|||
Formulat help please
Try .....
curSum = Nz(DSum("[Total]", "[WIP_Report_Initial_b]", "Region = '" & Me.State & "'"), 0) -- Ricky Hicks - Access MVP "Tanya via AccessMonster.com" u15820@uwe wrote in message news:5c22baaab99c0@uwe... 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200602/1 |
#4
|
|||
|
|||
Formulat help please
Thanks that got it working.
Ricky Hicks [MVP] wrote: Try ..... curSum = Nz(DSum("[Total]", "[WIP_Report_Initial_b]", "Region = '" & Me.State & "'"), 0) Hi, [quoted text clipped - 10 lines] State), 0) Me.txtOrderTotal = curSum -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200602/1 |
Thread Tools | |
Display Modes | |
|
|