borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Advise needed)Next Topic (SaveAs & ChangeFileOpenDirectory) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : assign new record source to a report
Poster Message
seem
Level: Graduate

Registered: 28-11-2005
Posts: 12

icon assign new record source to a report

Hi,
i'm working on an access project and i'm trying to build a report based on an SQL statement and assign it to the report in VB using:
Report_ReportName.RecordSource = "SQL statement"

but when i try to execute it i have this run time error: "you can't set the record source property after printing has started"

can any1 tell me how can i change the record source property of a report plz

thank you in advance  

____________________________
Seem Haroun

19-07-2006 at 06:34 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: assign new record source to a report

Hi,
Put your code in the Report_Open Event. That will work.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

20-07-2006 at 07:11 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : assign new record source to a report
Previous Topic (Advise needed)Next Topic (SaveAs & ChangeFileOpenDirectory) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder