Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting data source of data report

Status
Not open for further replies.

sp88sp88

Programmer
Joined
Nov 19, 2005
Messages
4
Location
GB
Hello,
I have already created a data environment with a connection to my back-end access database. Also I have made a data report that uses this connection to successfully display all records from one of the database tables.

Now I need to modify the data report so that it shows only search results returned in a DBGrid (the grid is bound to the DAO dat1). I have tried the following code:
Code:
Private Sub cmdPrint_Click()
Set datareport1.DataSource = dat1.Recordset
datareport1.show
End Sub
But at runtime, this produces "Runtime Error 13: Type Mismatch."

Any ideas on how to correct this problem (maybe there are some other properties on the report that are incorrectly set?)?

Any help greatly appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top