From: Marianne on
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!
From: XPS35 on
=?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

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

"XPS35" wrote:

> =?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
>
> .
>
From: Douglas J. Steele on
Peter had a slight typo (he left out an ampersand):

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

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


"Marianne" <Marianne(a)discussions.microsoft.com> wrote in message
news:D18DBA2C-3805-4FDA-9A5B-6427A44E2533(a)microsoft.com...
> When I use the AND I receive the Data Type Mismatch error.
>
> "XPS35" wrote:
>
>> =?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
>>
>> .
>>


From: Marianne on
Thanks very, very much to both of you! Have a wonderful day!

"Douglas J. Steele" wrote:

> Peter had a slight typo (he left out an ampersand):
>
> "[PymtInvID]= " & lngInvID & " AND [InvLineNum] = " & lngLineNum
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Marianne" <Marianne(a)discussions.microsoft.com> wrote in message
> news:D18DBA2C-3805-4FDA-9A5B-6427A44E2533(a)microsoft.com...
> > When I use the AND I receive the Data Type Mismatch error.
> >
> > "XPS35" wrote:
> >
> >> =?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
> >>
> >> .
> >>
>
>
> .
>