View Single Post
  #15  
Old December 13th, 2006, 11:44 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default DSUM with AND in access

Do you have a statement

Dim doej As String

anywhere in your code?

If so, whe in the same routine as where this code is, or in some other
routine?

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


"Thomy5 via AccessMonster.com" u30166@uwe wrote in message
news:6ab71913f2d38@uwe...
When i enter it as :

intUnder31 = DSum("Nz([Under31])", "tblAbsense", "Nz([EmployeeID], ' " &
doej
& " ' ) = '" & Me.EmployeeID & "' AND
Nz([Start_Date_Of_Absense],#9/24/2006#)
# " & dteSDate & " # ")

it returns an error " Variable not defined" with doej highlighted.
I'm kind of new at this and mostly self taught. could you please explain
what
you mean by "where doej is declaired"?

Douglas J. Steele wrote:
That's not what I said to do. Remove the quotes around doej:

intUnder31 = DSum("Nz([Under31])", "tblAbsense", "Nz([EmployeeID],'" &
doej
& "') = '" & Me.EmployeeID & "'AND
Nz([Start_Date_Of_Absense],#9/24/2006#)

# " & dteSDate & " # ")

If that still doesn't work, then please answer my question about where
doej
is declared.

Douglas,

[quoted text clipped - 24 lines]

-Thomy5


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1