gchwee
04-16-2004, 06:21 PM
dim m, a, b, name, datein, dateend
name = text3.text
datein = text1.text
dateend = text2.text
m = text4.text
'ERROR 1:
Report1.RecordSelectionFormula = "{Table1.name} =" & name & "AND {Table1.date} IN Date(" & a &") To Date(" & b &")"
'ERROR 2:
Report1.RecordSelectionFormula = "{Table1.name} =" & name & "AND month({Table1.date} in [" & m &"," & m & "])"
I allow the user to key in the "date range"/"month" + name in vb, then pass the selectionformula to the crystal report designed.
For example1: name = KEN, a = 2003, 12, 31 , b = 2003, 01, 31
then the report will print out the customer name equal to KEN and transaction during the period.
For example2: name = Steven, m = 2
then the report will print out the customer name equal to Steven and transaction during February.
Anyone can help? :)
name = text3.text
datein = text1.text
dateend = text2.text
m = text4.text
'ERROR 1:
Report1.RecordSelectionFormula = "{Table1.name} =" & name & "AND {Table1.date} IN Date(" & a &") To Date(" & b &")"
'ERROR 2:
Report1.RecordSelectionFormula = "{Table1.name} =" & name & "AND month({Table1.date} in [" & m &"," & m & "])"
I allow the user to key in the "date range"/"month" + name in vb, then pass the selectionformula to the crystal report designed.
For example1: name = KEN, a = 2003, 12, 31 , b = 2003, 01, 31
then the report will print out the customer name equal to KEN and transaction during the period.
For example2: name = Steven, m = 2
then the report will print out the customer name equal to Steven and transaction during February.
Anyone can help? :)