I have tried everything and still I can't get this where condition to pass to the query and open the report. It works off a command button on the form the date info comes from it has to work this way don't ask why!!!
----------------------------------------------------
Private Sub Start_Click()
On Error GoTo Err_Start_Click
Dim stDocName As String
Dim DateRange As Variant
Dim Installer As String
stDocName = "Installer_Summary_Door"
DateRange = "[Date to Install]=" & ">=#" & Me.Text3 & "#"
DateRange = DateRange & " and " & "<=#" & Me.Text5 & "#"
' The next line works when assigned and sent to docmd
'Installer = "[Installer]='" & Me.Combo0 & "'"
'this just pops up a box to show me the completed statement
MsgBox (DateRange)
DoCmd.OpenReport stDocName, acViewPreview, , DateRange
Exit_Start_Click:
Exit Sub
Err_Start_Click:
MsgBox Err.Description
Resume Exit_Start_Click
End Sub
-------------------------------------------------------
this version gives a
syntax error (missing operator) in query expression
error
I have tried various different combinations others give
a data type mismatch error
any help?????
----------------------------------------------------
Private Sub Start_Click()
On Error GoTo Err_Start_Click
Dim stDocName As String
Dim DateRange As Variant
Dim Installer As String
stDocName = "Installer_Summary_Door"
DateRange = "[Date to Install]=" & ">=#" & Me.Text3 & "#"
DateRange = DateRange & " and " & "<=#" & Me.Text5 & "#"
' The next line works when assigned and sent to docmd
'Installer = "[Installer]='" & Me.Combo0 & "'"
'this just pops up a box to show me the completed statement
MsgBox (DateRange)
DoCmd.OpenReport stDocName, acViewPreview, , DateRange
Exit_Start_Click:
Exit Sub
Err_Start_Click:
MsgBox Err.Description
Resume Exit_Start_Click
End Sub
-------------------------------------------------------
this version gives a
syntax error (missing operator) in query expression
error
I have tried various different combinations others give
a data type mismatch error
any help?????