MISTAKE OF SYNTAX (Operator is Absent)

  • Thread starter Thread starter Douglas J. Steele
  • Start date Start date
D

Douglas J. Steele

Don't know why it should be complaining about those specific values, but you
MUST use mm/dd/yyyy format for your date, regardless of what your regional
settings are. It will take 12/04/2004 as 4 Dec, 2004, not 12 Apr, 2004.

One thing to try, though, is change your declarations to

Dim rstDebito As DAO.Recordset
Dim rstVale As DAO.Recordset
 
as below and gives the following message MISTAKE OF SYNTAX (Operator is
Absent) in the expression of query" [CodCx] = ' 1 ' AND [DtJogo]=#04/04/2004
#'

Dim rstDebito As Recordset
Dim rstVale As Recordset
Dim strCodCx As Integer
Dim strDtJogo As Date
Dim strCriteria As String
Dim CurValeSoma As Double
Dim CurValeTb As Double

' Entrance of Parameters for I Calculate of you are Worth, based on the
field Debit of TbJogo'

Set rstDebito = CurrentDb.OpenRecordset("TbVales")
strCodCx = InputBox("Código do Caixa ?")
strDtJogo = InputBox("Dt do Jogo ?")

' I calculate of the Sum of all the Debits based on the parametros'

CurValeSoma = DSum("[Debito]", "TbVales", "'[CodCx] ='" & strCodCx & "' And
[DtJogo]=#" & Format(strDtJogo, "dd/mm/yyyy") & "#")

I don't know what to do.
 
Back
Top