Hi,
My problem is vb6 datareport. I have dataenvironment and it's connected to access.
My form has two textboxes Text1 and Text2. this is meant to show reports between two dates (text1-text2) but it
doesn't do that. It shows report but there is now data in it but there should be.
Date-properties in datareport is correct.
If somebody knows what's wrong I'd like to know. Thanks
Tables are orders, customers, date
Private Sub Command1_Click()
On Error GoTo Err
DataEnvironment1.rsCommand1.Source = "Select * FROM Orders WHERE Date BETWEEN FORMAT(Date,'dd.mm.yyyy')='" & Text1.Text & "'AND FORMAT (Date,'dd.mm.yyyy')='" & Text2.Text & "' Order by CUSTOMERS"
DataEnvironment1.rscommand1.Open
rptReport.Show
Unload Me
Exit Sub
Err:
DataEnvironment1.rscommand1.Close
DataEnvironment1.rsCommand1.Source = "Select * FROM Orders WHERE Date BETWEEN FORMAT(Date,'dd.mm.yyyy')='" & Text1.Text & "'AND FORMAT (Date,'dd.mm.yyyy')='" & Text2.Text & "' Order by CUSTOMERS"
End Sub
My problem is vb6 datareport. I have dataenvironment and it's connected to access.
My form has two textboxes Text1 and Text2. this is meant to show reports between two dates (text1-text2) but it
doesn't do that. It shows report but there is now data in it but there should be.
Date-properties in datareport is correct.
If somebody knows what's wrong I'd like to know. Thanks
Tables are orders, customers, date
Private Sub Command1_Click()
On Error GoTo Err
DataEnvironment1.rsCommand1.Source = "Select * FROM Orders WHERE Date BETWEEN FORMAT(Date,'dd.mm.yyyy')='" & Text1.Text & "'AND FORMAT (Date,'dd.mm.yyyy')='" & Text2.Text & "' Order by CUSTOMERS"
DataEnvironment1.rscommand1.Open
rptReport.Show
Unload Me
Exit Sub
Err:
DataEnvironment1.rscommand1.Close
DataEnvironment1.rsCommand1.Source = "Select * FROM Orders WHERE Date BETWEEN FORMAT(Date,'dd.mm.yyyy')='" & Text1.Text & "'AND FORMAT (Date,'dd.mm.yyyy')='" & Text2.Text & "' Order by CUSTOMERS"
End Sub