dlookup sum

  • Thread starter Thread starter deen
  • Start date Start date
D

deen

Hi All,

Pls Help me on this 2formula,Is not working fine can anyone help me on
this.

Reg Code Is a Text Format


=Sum(DLookUp("Amount","Paid details","Reg Code=" & nz([Reg Code] &
"")))


=Sum(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" &
[Reg Code] & "'"))


Regards,

deen
 
The table name doesn't go in brackets.

=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))

--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________
 
Uh, yes the table name needs to be in brackets, because it's got a space in
it.

A potential problem is that Amount might be Null for some value, so you
should use

=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] &
"'")))

However, why not just use

=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] & "'")



--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


boblarson said:
The table name doesn't go in brackets.

=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))

--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


deen said:
Hi All,

Pls Help me on this 2formula,Is not working fine can anyone help me on
this.

Reg Code Is a Text Format


=Sum(DLookUp("Amount","Paid details","Reg Code=" & nz([Reg Code] &
"")))


=Sum(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" &
[Reg Code] & "'"))


Regards,

deen
 
Hi All,

I Have 2 tables, 1 is main, and 2nd is paid details,

1.The main cotains

Reg Code Name Add DOJ DOB


2.Paid Details table contains,

Reg Code1 Paid Date Amount


I was Make this 2 table as relationship based on regcode,

and i was make form also like this(sub form).


But i was facing the problem in Total,

in the text box i was try lot of below formula but is not working

=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))



=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg
Code] &
"'")))


=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] &
"'")


Regards,

deen


















Uh, yes the table name needs to be in brackets, because it's got a space in
it.

A potential problem is that Amount might be Null for some value, so you
should use

=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] &
"'")))

However, why not just use

=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] & "'")

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




The table name doesn't go in brackets.
=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP
Tutorials athttp://www.btabdevelopment.com
__________________________________

Hi All,
Pls Help me on this 2formula,Is not working fine can anyone help me on
this.
Reg Code Is a Text Format
=Sum(DLookUp("Amount","Paid details","Reg Code=" & nz([Reg Code] &
"")))
=Sum(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" &
[Reg Code] & "'"))
Regards,
deen- Hide quoted text -

- Show quoted text -
 
Umm, no it doesn't Doug - it is in quotes so it doesn't need the brackets.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


Douglas J. Steele said:
Uh, yes the table name needs to be in brackets, because it's got a space in
it.

A potential problem is that Amount might be Null for some value, so you
should use

=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] &
"'")))

However, why not just use

=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] & "'")



--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


boblarson said:
The table name doesn't go in brackets.

=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))

--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


deen said:
Hi All,

Pls Help me on this 2formula,Is not working fine can anyone help me on
this.

Reg Code Is a Text Format


=Sum(DLookUp("Amount","Paid details","Reg Code=" & nz([Reg Code] &
"")))


=Sum(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" &
[Reg Code] & "'"))


Regards,

deen
 
Could it possibly be that you aren't referring to the right field name? [Reg
Code] is not in your details. [Reg Code1] is, but nowhere are you using it.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


deen said:
Hi All,

I Have 2 tables, 1 is main, and 2nd is paid details,

1.The main cotains

Reg Code Name Add DOJ DOB


2.Paid Details table contains,

Reg Code1 Paid Date Amount


I was Make this 2 table as relationship based on regcode,

and i was make form also like this(sub form).


But i was facing the problem in Total,

in the text box i was try lot of below formula but is not working

=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))



=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg
Code] &
"'")))


=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] &
"'")


Regards,

deen


















Uh, yes the table name needs to be in brackets, because it's got a space in
it.

A potential problem is that Amount might be Null for some value, so you
should use

=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] &
"'")))

However, why not just use

=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] & "'")

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




The table name doesn't go in brackets.
=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP
Tutorials athttp://www.btabdevelopment.com

"deen" wrote:
Pls Help me on this 2formula,Is not working fine can anyone help me on
this.
Reg Code Is a Text Format
=Sum(DLookUp("Amount","Paid details","Reg Code=" & nz([Reg Code] &
"")))
=Sum(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" &
[Reg Code] & "'"))

deen- Hide quoted text -

- Show quoted text -
 
Son of a gun, you're right! I was under the belief that a virtual SQL
statement was being created, which used the literal values passed, so that
you need to enclose improper names in the square brackets.

Sorry about that!

(There's nothing wrong with putting it in brackets, though, so I do question
your comment "The table name doesn't go in brackets.")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


boblarson said:
Umm, no it doesn't Doug - it is in quotes so it doesn't need the brackets.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


Douglas J. Steele said:
Uh, yes the table name needs to be in brackets, because it's got a space
in
it.

A potential problem is that Amount might be Null for some value, so you
should use

=Sum(Nz(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg
Code] &
"'")))

However, why not just use

=DSum("[Amount]", "[Paid Details]", "[Reg Code]= '" & [Reg Code] & "'")



--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


boblarson said:
The table name doesn't go in brackets.

=Sum(Dlookup("[Amount]", "Paid Details", "[Reg Code]= '" &
[Reg Code] & "'"))

--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________


:

Hi All,

Pls Help me on this 2formula,Is not working fine can anyone help me on
this.

Reg Code Is a Text Format


=Sum(DLookUp("Amount","Paid details","Reg Code=" & nz([Reg Code] &
"")))


=Sum(Dlookup("[Amount]", "[Paid Details]", "[Reg Code]= '" &
[Reg Code] & "'"))


Regards,

deen
 
Back
Top