Hello
I just can't get this piece working! I'm pulling out my hairs right now ...
I hope one of you can point me to the problem ...
I just paste the part where I have a problem with:
If I put this SQL in a querry, it works perfect ...
If I cut the SQL before the first "AND", it works perfect ...
Many thanks
Kurt
I just can't get this piece working! I'm pulling out my hairs right now ...
I hope one of you can point me to the problem ...
I just paste the part where I have a problem with:
Code:
Dim dtStart As Date
Dim dtEind As Date
' ...
If Me.cmbKwartaal.Value = "Q1" Then
dtStart = "01/01/" & Format(Date, "yyyy")
dtEind = "31/03/" & Format(Date, "yyyy")
ElseIf Me.cmbKwartaal = "Q2" Then
dtStart = "01/04/" & Format(Date, "yyyy")
dtEind = "30/06/" & Format(Date, "yyyy")
ElseIf Me.cmbKwartaal = "Q3" Then
dtStart = "01/07/" & Format(Date, "yyyy")
dtEind = "30/09/" & Format(Date, "yyyy")
ElseIf Me.cmbKwartaal = "Q4" Then
dtStart = "01/10/" & ((Format(Date, "yyyy")) - 1)
dtEind = "31/12/" & ((Format(Date, "yyyy")) - 1)
Else
Call MsgBox("Error", vbOKOnly)
End If
'...
'Here I have my problem:
DoCmd.OpenReport "rptPayment", acViewPreview, , _
"(([logPersoneel.prsID]=" & RST!prsID _
& ") AND ([logInterventies.intDatum]>=#" & dtStart _
& "#) AND ([logInterventies.intDatum]<=#" & dtEind & "#));", acHidden
If I put this SQL in a querry, it works perfect ...
If I cut the SQL before the first "AND", it works perfect ...
Many thanks
Kurt
Last edited: