Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

monthly-yearly report using CR-VB

Status
Not open for further replies.

athos07

Programmer
Aug 1, 2002
19
AU
what will i do if i want to have an input in vb using combo-box. And report generate thru CR. i have already code but it does not work. year always appear 1905.

startdate, enddate declared as STRING

startdate = combo1(0).Text
enddate = combo1(1).Text
startdate = Format(startdate, "mm/yyyy")
enddate = Format(enddate, "mm/yyyy")

CReport1.Formulas(0) = "From='" & startdate & "'"
CReport1.Formulas(1) = "To='" & enddate & "'"
CReport1.Destination = 0
CReport1.ReportFileName = (App.Path "\monthlyreport.rpt")

If Len(combo1(0).Text) And Len(combo1(1).Text) Then
strselectCriteria = "{Masterlist.BidDate} In Date (" & Format$(combo1(0).Text, "YYYY,MM,DD") & ") To Date(" & Format$(combo1(1).Text, "YYYY,MM,DD") & ")"
Else
strselectCriteria = ""
End If

CReport1.SelectionFormula = strselectCriteria
CReport1.DataFiles(0) = strDbName
CReport1.RetrieveDataFiles
CReport1.Action = 1

thank you for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top