Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

run time error

Posted on 2006-11-29
4
Medium Priority
?
370 Views
Last Modified: 2008-01-09
Hi experts
im not even sure if this is right place to post my question but i hope someone can help me. im generating crystal reports version 10 from MS access as front end and SQL is used as the back end. i got three combo boxes
parent accounts(coming from a table)--- report end date(only one value) --schedules(reports-manually typed). Following is my entire VB code

ption Compare Database
'Option Explicit

Public crxapplication As New CRAXDRT.Application
Public crxreport As CRAXDRT.Report



Private Sub Form_Load()

    'Maximizes the form
    DoCmd.Maximize
    Me!CrystalActiveXReportViewer1.Top = 600
    Me!CrystalActiveXReportViewer1.Left = 800
    Me!CrystalActiveXReportViewer1.Height = 8000
    Me!CrystalActiveXReportViewer1.Width = 12000
   
    strReport = Forms![Mainform]![cbo_Schedules].Value
   

Set crxreport = crxapplication.OpenReport("reports path" & strReport & ".rpt")
crxreport.ParameterFields.GetItemByName("account_parent").AddCurrentValue Forms![Mainform]![cbo_ParentAccounts].Value
'crxreport.ParameterFields.GetItemByName("report_end_dt").AddCurrentValue Forms![Mainform]![cbo_report_enddt].Value
CrystalActiveXReportViewer1.ReportSource = crxreport
CrystalActiveXReportViewer1.ViewReport
CrystalActiveXReportViewer1.Zoom (100)

The problem i have is that im able to view the reports once fine but when i choose the same account for other reports or just choose any other account from the drop down i get this error

run-time error '-2147189553 (80047ccf):
the value or range you are adding has already existed
any kind of help would be highly appreciated
0
Comment
Question by:zafridi
4 Comments
 
LVL 34

Accepted Solution

by:
jefftwilley earned 1500 total points
ID: 18039673
You probably want to close your recordset and the app once the code has ran. Sounds like the occurance of CRAXDRT remains open.
J
0
 
LVL 85
ID: 18039677
Which line does the error occur on?
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18039691
I'm not familiar using Access  with Crystal. You might want to question to the Crystal Reports TA. http://www.experts-exchange.com/Databases/Crystal_Reports/ 
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18039816
<aside>
just out of curiosity, why use Crystal instead of the report engine inside Access itself?
</aside>
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question