Hello
I am using Crystal 8.5 and a Access Db. I am using dates and option buttons to let the user to get the data and populate my crystal report. What I am trying to do is allow the user to select the distinct account number then date to fill the report. I have the account number populated in a combo box in the form load event. When I run it a error comes up that it is not in my query and a string is required. The combobox is populated on the form load even so the numbers are present when its time to select the date
Private Sub cmd_Click()
Me.Visible = False
strAccNumber = Combo1.List(Combo1.ListIndex)
If Option1 Then
With Form1.cr1
.DataFiles(0) = App.Path & "\Orders Main.mdb"
.ReportFileName = App.Path & "\Report3.rpt"
.SelectionFormula = "{Sales.Account Number}&{Sales.Bill Date} in Date (" & Format$(DTPicker1.Value, "yyyy,mm,dd" & " To Date (" & Format$(DTPicker2.Value, "yyyy,mm,dd" & ""
.Action = 1
.PageZoom (89)
End With
Else
End If
If Option2 Then
With Form1.cr1
.DataFiles(0) = App.Path & "\Orders Main.mdb.mdb"
.ReportFileName = App.Path & "\Report2a.rpt"
.SelectionFormula = "{Sales.Account Number}&{Sales.Bill Date}(" & Format$(DTPicker1.Value, "yyyy,mm,dd" & " To Date (" & Format$(DTPicker2.Value, "yyyy,mm,dd" & ""
.Action = 1
.PageZoom (89)
End With
End If
End Sub
Again I would like to use the Account Number and Date to fill report. Hopefully this will explain it enough. If not let me know
Thanks
Bob
I am using Crystal 8.5 and a Access Db. I am using dates and option buttons to let the user to get the data and populate my crystal report. What I am trying to do is allow the user to select the distinct account number then date to fill the report. I have the account number populated in a combo box in the form load event. When I run it a error comes up that it is not in my query and a string is required. The combobox is populated on the form load even so the numbers are present when its time to select the date
Private Sub cmd_Click()
Me.Visible = False
strAccNumber = Combo1.List(Combo1.ListIndex)
If Option1 Then
With Form1.cr1
.DataFiles(0) = App.Path & "\Orders Main.mdb"
.ReportFileName = App.Path & "\Report3.rpt"
.SelectionFormula = "{Sales.Account Number}&{Sales.Bill Date} in Date (" & Format$(DTPicker1.Value, "yyyy,mm,dd" & " To Date (" & Format$(DTPicker2.Value, "yyyy,mm,dd" & ""
.Action = 1
.PageZoom (89)
End With
Else
End If
If Option2 Then
With Form1.cr1
.DataFiles(0) = App.Path & "\Orders Main.mdb.mdb"
.ReportFileName = App.Path & "\Report2a.rpt"
.SelectionFormula = "{Sales.Account Number}&{Sales.Bill Date}(" & Format$(DTPicker1.Value, "yyyy,mm,dd" & " To Date (" & Format$(DTPicker2.Value, "yyyy,mm,dd" & ""
.Action = 1
.PageZoom (89)
End With
End If
End Sub
Again I would like to use the Account Number and Date to fill report. Hopefully this will explain it enough. If not let me know
Thanks
Bob