Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 322523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:56:48+00:00 2026-05-12T08:56:48+00:00

Using VB 6 and Crystal Report 8.5 I want to pass the date parameter

  • 0

Using VB 6 and Crystal Report 8.5

I want to pass the date parameter filed in CRViewer control.

Code:

Dim crApp As CRAXDRT.Application
Dim Report As CRAXDRT.Report
CR2.ParameterFields(1) = "txtFromDate;" & dtpFrom.Value & ";true"
CR2.ParameterFields(2) = "txtToDate;" & dtpTo.Value & ";true"
CR2.DataFiles(0) = App.Path & "\STAR.mdb"
CR2.ReportFileName = App.Path & "\MS.rpt"
Set crApp = New CRAXDRT.Application
Set Report = crApp.OpenReport(App.Path & "\MS.rpt")
CRViewer2.ReportSource = Report
CRViewer2.ViewReport

Parameterfield(1), Parameterfield(2) was not displaying in the crviewercontrol.

How to pass the date parameter field in the CRViewer control?

Need VB 6 code help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:56:48+00:00Added an answer on May 12, 2026 at 8:56 am

    To my understanding, you have to pass the date to the parameter field in the same format as CR is expecting. Open the report in Crystal Reports, and go to the Edit screen for each parameter field. Make sure the fields are of Date type instead of DateTime as it doesn’t seem you need to account for time given your example. Then click on “Set Default Values”, this screen will show you the format CR is expecting for the parameter (usually M/D/YYYY). In your code, format your date value to be passed to the parameter:

    CR2.ParameterFields(1) = "txtFromDate;" & Format(dtpFrom.Value, "M/D/YYYY") & ";true"
    CR2.ParameterFields(2) = "txtToDate;" & Format(dtpTo.Value, "M/D/YYYY") & ";true"
    

    Edit: Or D/M/YYYY, just depends on what CR wants.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know I can dynamically modify an existing Crystal Report (using C#
Using Crystal Report 8.5 How to skip blank pages? I want to skip blank
I am using Crystal Report 2008 with C# , have a WinForm and want
Using crystal report 9 Example PersonID Date 3405 28-02-2009 3405 29-02-2009 3406 25-02-2009 3406
Using Crystal Report 9 Table1 Fields Date ShiftName ID Name Intime Outtime Department 02-02-2009
Using VB6 & Crystal Report 9. Need help with the VB6 code. When i
I have built a web page which contains a Crystal Report built using the
Using Crystal Report 8.5 Generating a report from table1 My Crystal Report Output ID
I want to print the values on crystal report that user input on the
I have a Crystal Report set up to run with my windows forms application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.