Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

setting controls in report from form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason - 31 Mar 2005 10:07 GMT
Hi,

I was wondering what the syntax is for setting the controlsource of a report
based on the values from a form.

I have a form which has recordset, but i want it do it for a report as well,
but a report doensn't have a recordset property.

So basically i want to use values from the form's controls to display in the
report. All textboxes in the report has the same names as in the form.

Can it be done something like for each control in form do...... (i don't
know the syntax)
Nikos Yannacopoulos - 31 Mar 2005 11:41 GMT
Jason,

Reports have a RecordSource property which can be changed
programatically. On the other hand, if what you are trying to achieve is
to filter the report based on selections in the form, then the
WhereCondition argument of DoCmd.OpenReport is your friend! All you
would need is something along the limes of:

strWhere = "[Field1] = '" & Me.Contol1 & "'"
DoCmdOpenReport "MyReport", acViewPeview, , strWhere

behind the command button (on the same form) that opens the report.

HTH,
Nikos

> Hi,
>
[quoted text clipped - 9 lines]
> Can it be done something like for each control in form do...... (i don't
> know the syntax)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.