Private Sub PrintThis()
Dim dsr As dsrSwitch
Dim rs As ADODB.Recordset
On Error GoTo errHandler
Set dsr = New dsrSwitch
Set rs = GetData(rs) ' either open your ADODB.recordset here or use one that is already open
With dsr
Set .DataSource = rs
.DataMember = ""
.Visible = True
.PrintReport True, rptRangeAllPages
While .AsyncCount > 0
DoEvents
Wend
End With
Unload dsr
Set dsr = Nothing
Set rs = Nothing
Exit Sub
errHandler:
etc.
> -----Original Message-----
> From: herbe@a... [SMTP:herbe@a...]
> Sent: Wednesday, March 20, 2002 7:41 AM
> To: professional vb
> Subject: [pro_vb] Datareport
>
> I have on form that uses ADODB code, but I now want to add a
> datareport, but I want the datareport to use the ADODB code too.
>
> How Could I do this? I tired the other day setting up the report code
> with ADODB code, but it didn't work
>
>
> Any Suggestions?
>
>
>
>
>