Sub QryReport()
On Error Resume Next
Dim QryDef As QueryDef
Dim str As String
Set QryDef = dbase.QueryDefs("balancesheet")
dbase.QueryDefs.Refresh
If Err.Number = 3265 Then
Set QryDef = dbase.CreateQueryDef("balancesheet")
dbase.QueryDefs.Refresh
End If
str = "select * from [balancesheet]" & _
" where Date ='" & Dtpicker.Value & "'"
QryDef.SQL = str
datareport1.Show
End Sub
here show the all data. but the sql command not work. I mean when I select a date the report didn't show that date's data. it show all data. what problem ?