Digital Oatmeal
Registered User.
- Local time
- Today, 09:54
- Joined
- May 17, 2011
- Messages
- 15
Hello All,
I generally find answers by searching the forums but this particular one seems very niche.
I have a preexisting Crystal Reports 10 report and I am trying to print it out of an Access 2007 (.accdb) database. I am a complete novice in CR but I do pretty well in Access. The connection in CR to access is ODBC because (first I don’t know what I’m doing and) I am using .accdb instead of .mdb. I have the report printing but every time it does it generates a popup box to select the database. I want that to stop.
Here’s my code. I would very much appreciate any clear correction anyone can offer my dumb self.
I generally find answers by searching the forums but this particular one seems very niche.
I have a preexisting Crystal Reports 10 report and I am trying to print it out of an Access 2007 (.accdb) database. I am a complete novice in CR but I do pretty well in Access. The connection in CR to access is ODBC because (first I don’t know what I’m doing and) I am using .accdb instead of .mdb. I have the report printing but every time it does it generates a popup box to select the database. I want that to stop.

Here’s my code. I would very much appreciate any clear correction anyone can offer my dumb self.

Code:
Public Function PrintBOL()
Dim CBO As String
Dim CR As CRAXDDRT.Application
Dim rpt As CRAXDDRT.Report
Set CR = New CRAXDDRT.Application
Set rpt = CR.OpenReport("X:\reportFilePath")
‘ set report to run off of a combo box on the form
CBO = Forms![ProductShipment]![CboOrdno].Value
‘ remove spaces from the Order Number
CBO = Replace(CBO, " ", "")
‘ send CBO to hidden field in the report
rpt.ParameterFields.GetItemByName("DataFeed").AddCurrentValue CBO
rpt.PrintOut promptUser:=False, numberOfCopy:=1
Set rep = Nothing
Set CR = Nothing
End Function