954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

passsing value to Crystal Report 8.5

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...

russell214
Newbie Poster
7 posts since Nov 2005
Reputation Points: 10
Solved Threads: 0
 

if crpt is the control name used in the form then

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

Try it once

maheshsayani
Light Poster
45 posts since Jul 2006
Reputation Points: 10
Solved Threads: 2
 

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) = " = '" & SSTAB1.CAPTION & "'"

maheshsayani
Light Poster
45 posts since Jul 2006
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You