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!

Using a formula to call a form reference..HELP!

Status
Not open for further replies.

mgkSHA

Programmer
Jul 12, 2002
126
US
I have a project I am working on in VB 6.0 that utilizes Crystal Reports. I have been asked to create a form which allows the user to select a range of dates (the use of two datacombo boxes ...beginning date and end date). Once the user selects their range of dates, they click a command button and Crystal reports returns the data for that given time frame. I am trying to write a formula that allows for "TodaysDate" (the datafield)to "be in-between" the given dates. I guess I am looking for something like this:

formula outline:

{ado.TodaysDate} is in the period (Formname.datacombo) and (Formname.datacombo2)

I have done this sort of thing in VB and Access, but I don't know how (or if it's possible to) make a form reference in Crystal Reports. If I can't, what is a way around this? PLEASE HELP. Thanks

Martin K
 
It would be much easier to simply insert a date range parameter in your crystal report, and when the report executes the user will be prompted.

Insert-Field Object-Parameter field, manke it a date value and range type.

Then go to your record selection formula and restrict the rport to the Date Range:

{datefield} in {?DateRangeParameter} Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Yeah, I actually figured that part out..thanks though. I have another question pertaining to it. If the user clicks the command button they are prompted for a date range. My question is, everytime they click the command button after the first time(say they want to choose another range) the same report pops up with the first parameters set.

How can I make the parameter refresh everytime the user clicks the command button. As in, I click the button I am prompted, the report opens. I close the report, I click the button and I get prompted again. Thanks

Martin K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top