Unanswered: Strang error in VB6 with Crystal reports
When I'm trying to add parameter information, I'm getting the following error:
Run-time error '-2147189553 (80047ccf)':
The value or range you are adding has already existed.
Has anyone ever seen this error before. Help just tells you that it's an automation error, with no other explanations, which is absolutely no help at all. I've been graffling with this all day and getting nowhere fast. I've created a similiar application in the past that uses the same commands to load parameter data and it works just fine, which leads me to think that there's possibly something in the report, but when I compare the two, I do not see anything that should be causeing this error. However, if I reference the other report, I do not get the above error. What gives?
Example of the line of code that's causing the error: The bold line is where it dies.
Dim CrxApp As New CRAXDRT.Application 'Acknowledge report library
Set CrxApp = New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report
Dim StrJobNum As String, StrReport As String
Dim dStartDate As Date, dEndDate As Date
'If user has not chosen a report, set a default
If Len(LTrim(RTrim(strslectedreport))) = 0 Then
StrReport = "PubReg.rpt"
StrReport = StrSelectedReport
StrReport = App.Path & "\" & StrReport
Set CrxRpt = CrxApp.OpenReport(StrReport)
CRViewer91.ReportSource = CrxRpt
dStartDate = Format(FrmMain.MskStartDate, "mm-dd-yyyy")
dEndDate = Format(FrmMain.MskEndDate, "mm-dd-yyyy") CrxRpt.ParameterFields(1).AddCurrentValue (dStartDate)
I think I have found the problem I was having maybe this will help someone else
In Crystal Reports if you change a db, sp etc in database expert the fields in the report disappear. If you forget one or (for some reason) don't readd the field from the fields list you will get this error.
I've been getting the same error. Nothing wrong with the codes.
If you supply the parameters for the first round,no problem but if you give the same parameters for the second time the error comes.
I don't know what should be done on the codes.
Anyone to assist.