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!

Passing Date 1

Status
Not open for further replies.

pmaxon

Programmer
Sep 25, 2003
68
US
I am using VB6, CR8.5 and OCX - as everyone probably knows by now! ;o)
I have created a combobox on a form which loads up with dates in the form of 06/01/2001, etc.

On my report, I have created a parameter field called PDate which is the type Date and also have a database field called received_date which has the following formula:
{Claim.received_date} = {?PDate}

Running within CR, it prompts me for a date and seems to run correctly. When attempting to pass the combobox text from VB using:
.ParameterFields(0) = "PDate;" & Combo1.Text & ";TRUE;"
I get an "Invalid Parameter Field Error".

Searching through the forum I have not been able to find anything that helps me out. Any help would be greatly appreciated!

TIA
 
Howdy, Pat...

If you're using the .ocx, Crystal wants Date parameters passed like Date(YYYY,MM,DD).

So, you need to do something like:

.ParameterFields(0) = "PDate;Date(" & Year(CDate(Combo1.Text)) & "," & _
Month(CDate(Combo1.Text)) & "," & Day(CDate(Combo1.Text)) & ");true"

-dave
 
No problem Pat... you're doing wonders for my ego ;)

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top