0

I'm using VB6 as my frontend and MSACCESS as backend.

I have a field in tblHistory named "payperiod". I have put text in this field.

content of payperiod: JANUARY 1 - 15, 2006
JANUARY 16 - 31, 2006
FEBRUARY 1 - 15, 2006
FEBRUARY 16 - 28, 2006 and so on.

i have a SSTAB1 with 12 Tabs. each tab has a datagrid. Tab1.Caption = "January", Tab2.Caption = "February" Tab3.Caption = "March", until Tab12 = "December".

Now i want to get the report using Crystal Report for month based on SSTAB1.CAPTION.

here is my code: this will filter only the Month

Private Sub SSTab1_Click(PreviousTab As Integer)
AdoHistory.CommandType = adCmdText
AdoHistory.RecordSource = "select * from tblHistory where payperiod like '" & SSTab1.Caption & "%'"
AdoHistory.Refresh

End Sub

thanks in advance...

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by maheshsayani
0

if crpt is the control name used in the form then

Code is:
CRPT.selectionformulae = "payperiod like '" & SSTab1.Caption & "%'"

Try it once

0

If you want to send the month name as parameter to crystal report to display then create one formulaefield in cruystalreport

and from vbcode

crpt.formulaes(0) = "<FORMULAENAME in CRYSTAl REPORT> = '" & SSTAB1.CAPTION & "'"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.