Solved

it's that possible to open  a report with vba on a form that will also feed the report  record source - in access 2013

Posted on 2013-11-03
2
757 Views
Last Modified: 2013-11-03
hi

is there some way to feed the record source from a report with vba on the form that will open the report and then feed the record source

something like this
DoCmd.OpenReport "TotalIncomeR", acViewPreview
Reports!TotalIncomeR.RecordSource = sqlstr

Open in new window

0
Comment
Question by:bill201
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39620461
Try this:


DoCmd.OpenReport "TotalIncomeR", acViewPreview, OpenArgs := sqlstr

Open in new window


And in the Open Event of the report:

Me.Recordsource = Me.OpenArgs

Open in new window

0
 

Author Closing Comment

by:bill201
ID: 39620505
thanks alot
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question