Error 94 Invalid use of Null

M

Marianne

Hello!

I had a previous post on this but have narrowed my troubles to this line.

Why am I getting the Error 94 Invalid use of Null on the line of code for
the curPymtsByLine?

the locals window shows all the correct values for each variable.

Dim lngInvID As Long
Dim lngLineNum As Long
Dim curPymtsByLine As Currency

lngInvID = Nz(Me.PymtInvID)
lngLineNum = Nz(Me.InvLineNum)
***curPymtsByLine = DSum("[Pymt]", "PaymentDetail", "[PymtInvID]= " &
lngInvID & [InvLineNum] = lngLineNum)

As always, thanks for the help!
 
X

XPS35

=?Utf-8?B?TWFyaWFubmU=?= said:
Hello!

I had a previous post on this but have narrowed my troubles to this line.

Why am I getting the Error 94 Invalid use of Null on the line of code for
the curPymtsByLine?

the locals window shows all the correct values for each variable.

Dim lngInvID As Long
Dim lngLineNum As Long
Dim curPymtsByLine As Currency

lngInvID = Nz(Me.PymtInvID)
lngLineNum = Nz(Me.InvLineNum)
***curPymtsByLine = DSum("[Pymt]", "PaymentDetail", "[PymtInvID]= " &
lngInvID & [InvLineNum] = lngLineNum)

As always, thanks for the help!

As where-clause try:
"[PymtInvID]= " & lngInvID " AND [InvLineNum] = " & lngLineNum

--
Groeten,

Peter
http://access.xps350.com
http://foto.xps350.com
 
M

Marianne

When I use the AND I receive the Data Type Mismatch error.

XPS35 said:
=?Utf-8?B?TWFyaWFubmU=?= said:
Hello!

I had a previous post on this but have narrowed my troubles to this line.

Why am I getting the Error 94 Invalid use of Null on the line of code for
the curPymtsByLine?

the locals window shows all the correct values for each variable.

Dim lngInvID As Long
Dim lngLineNum As Long
Dim curPymtsByLine As Currency

lngInvID = Nz(Me.PymtInvID)
lngLineNum = Nz(Me.InvLineNum)
***curPymtsByLine = DSum("[Pymt]", "PaymentDetail", "[PymtInvID]= " &
lngInvID & [InvLineNum] = lngLineNum)

As always, thanks for the help!

As where-clause try:
"[PymtInvID]= " & lngInvID " AND [InvLineNum] = " & lngLineNum

--
Groeten,

Peter
http://access.xps350.com
http://foto.xps350.com

.
 
D

Douglas J. Steele

Peter had a slight typo (he left out an ampersand):

"[PymtInvID]= " & lngInvID & " AND [InvLineNum] = " & lngLineNum

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Marianne said:
When I use the AND I receive the Data Type Mismatch error.

XPS35 said:
=?Utf-8?B?TWFyaWFubmU=?= said:
Hello!

I had a previous post on this but have narrowed my troubles to this
line.

Why am I getting the Error 94 Invalid use of Null on the line of code
for
the curPymtsByLine?

the locals window shows all the correct values for each variable.

Dim lngInvID As Long
Dim lngLineNum As Long
Dim curPymtsByLine As Currency

lngInvID = Nz(Me.PymtInvID)
lngLineNum = Nz(Me.InvLineNum)
***curPymtsByLine = DSum("[Pymt]", "PaymentDetail", "[PymtInvID]= " &
lngInvID & [InvLineNum] = lngLineNum)

As always, thanks for the help!

As where-clause try:
"[PymtInvID]= " & lngInvID " AND [InvLineNum] = " & lngLineNum

--
Groeten,

Peter
http://access.xps350.com
http://foto.xps350.com

.
 
M

Marianne

Thanks very, very much to both of you! Have a wonderful day!

Douglas J. Steele said:
Peter had a slight typo (he left out an ampersand):

"[PymtInvID]= " & lngInvID & " AND [InvLineNum] = " & lngLineNum

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Marianne said:
When I use the AND I receive the Data Type Mismatch error.

XPS35 said:
=?Utf-8?B?TWFyaWFubmU=?= wrote:


Hello!

I had a previous post on this but have narrowed my troubles to this
line.

Why am I getting the Error 94 Invalid use of Null on the line of code
for
the curPymtsByLine?

the locals window shows all the correct values for each variable.

Dim lngInvID As Long
Dim lngLineNum As Long
Dim curPymtsByLine As Currency

lngInvID = Nz(Me.PymtInvID)
lngLineNum = Nz(Me.InvLineNum)
***curPymtsByLine = DSum("[Pymt]", "PaymentDetail", "[PymtInvID]= " &
lngInvID & [InvLineNum] = lngLineNum)

As always, thanks for the help!

As where-clause try:
"[PymtInvID]= " & lngInvID " AND [InvLineNum] = " & lngLineNum

--
Groeten,

Peter
http://access.xps350.com
http://foto.xps350.com

.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top