Error 94 Invalid use of Null

  • Thread starter Thread starter Marianne
  • Start date Start date
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!
 
=?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
 
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

.
 
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

.
 
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

.


.
 
Back
Top