is clientnum an identity field?
Printable View
is clientnum an identity field?
Yes it is...it is the primary key.Quote:
Originally posted by kleinma
is clientnum an identity field?
im sorry i forgot to ask.. what version of CR are you using?
Crystal Reports 8.5 and Visual Basic 6 ProQuote:
Originally posted by kleinma
im sorry i forgot to ask.. what version of CR are you using?
well i know you can pass parameters into crystal.. but i have no books in crystal and their site is pretty sucky... I do something similar to what you want to do.. and this is how I did it...
what you would do (1 way at least) is design the report in crystal and then save it to a drive (rpt file)
I just posted this for someone else on here actually.. but I will add a part to it for u
VB Code:
Public Sub RunReport(ClientNum as string) On Error GoTo EH: Dim CApp As New CRAXDRT.Application Dim CReport As CRAXDRT.Report Screen.MousePointer = vbHourglass ' Use the .OpenReport method of the Application object to set your Report object to a RPT file Set CReport = CApp.OpenReport("C:\MyReport.rpt") ' Use the DiscardSavedData method to ensure that your report hits the Database and refreshes the data CReport.DiscardSavedData CReport.RecordSelectionFormula = "{table.field} = " & ClientNum crView.ReportSource = CReport CReport.Database.Tables(1).SetLogOnInfo "SERVER", "DBNAME", "LOGON", "PASSWORD" crView.ViewReport ' Zoom the preview window crView.Zoom 75 Screen.MousePointer = vbDefault Exit Sub EH: MsgBox Err.Description End Sub
where crView is the viewer control...
add a reference to the crystal runtime too...
Here is another approach that I use frequently... http://www.vbforums.com/showthread.p...rystal+Reports