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 / Reports / Printing / October 2004

Tip: Looking for answers? Try searching our database.

show parameters passed from vb app on access report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ranimath - 26 Oct 2004 13:07 GMT
I have a visual basic application which opens an access report based on input
parameters. The following code is being used for the same:

dbpath = DATABASE_PATH
Set Acc = CreateObject("Access.Application")
Set DB2 = Acc.Application.DBEngine.Workspaces(0).OpenDatabase(dbpath, 0,
False, ";PWD=xxx")
Acc.OpenCurrentDatabase dbpath, False
Set DB2 = Nothing
Acc.Visible = True
Acc.DoCmd.Maximize
'Open the report with the specified where condition
Acc.DoCmd.OpenReport sReportName, acViewPreview, , where$

I am building the Where condition based on user input in the visual basic
form. The form is not in the access project. It is in the visual basic
project.

I want to display the values of the parameters on the access report. When i
give Forms.Formname.ControlName as the controlsource of the textbox on my
report, it gives me a #Name? error.

Pls advise as to how to get the parameters in the 'Where$' condition printed
on the report.I am using Visual basic 6 and access 2K. The form is not in the
access project.It is in the visual basic application.
Duane Hookom - 26 Oct 2004 15:54 GMT
The where$ value can be retrieved in the report from the Filter property.
You could add a text box to your report with a control source of:
Control Source: =[Filter]
This might be a little cryptic for users but should get your started.

Signature

Duane Hookom
MS Access MVP
--

>I have a visual basic application which opens an access report based on
>input
[quoted text clipped - 25 lines]
> the
> access project.It is in the visual basic application.
ranimath - 27 Oct 2004 06:47 GMT
Thank you for the solution provided. When I do this, I get the whole filter
condition printed on the Report.
For My filter condition appears as follows on the report:
(([TB_Role.Start_date] <= #10/27/2004# and( [TB_Role.End_date]is Null or
[TB_Role.End_Date]>= #10/27/2004#) )and ([TB_Person.Person_id]= 234) )

Is there any way to reference just the values? I mean to say I want only the
Date 10/27/2004 or some other specific condition value like that. How can i
specifically refer to that value?

> The where$ value can be retrieved in the report from the Filter property.
> You could add a text box to your report with a control source of:
[quoted text clipped - 30 lines]
> > the
> > access project.It is in the visual basic application.
Duane Hookom - 29 Oct 2004 03:35 GMT
You could write some code to "parse" out the values from the field names.

Signature

Duane Hookom
MS Access MVP
--

> Thank you for the solution provided. When I do this, I get the whole
> filter
[quoted text clipped - 48 lines]
>> > the
>> > access project.It is in the visual basic application.
 
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.