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 / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Combol Box and Report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chi - 06 Jun 2006 19:12 GMT
I have a combo box that listed the Department Names. I would like to create a
Print View button that will show only the Department which I selected in the
combo box.

Is possible to do that?

Please help.

Thanks
Chi

Chi
fredg - 06 Jun 2006 19:19 GMT
> I have a combo box that listed the Department Names. I would like to create a
> Print View button that will show only the Department which I selected in the
[quoted text clipped - 8 lines]
>
> Chi

Here is one method.
Add a command button to your form
Code it's click event:

DoCmd.OpenReport "ReportName", acViewPreview, , "[Department] = '" &
Me![cboDepartment] & "'"

The above assumes that [Department] datatype is Text.

If [Department] is a Number Datatype, then use:
"[Department] = " & Me![cboDepartment]
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Chi - 07 Jun 2006 18:01 GMT
Hi Fred,
Thanks for your respond. I have tried to apply the code to the form.
However, I got the Code Error message. Would you mind checking the code? It
has problem at the end of line. Sorry, I have no experience using the VBA.

Did I respond to the newsgroup? There are two REPLY buttons, so I am not
sure which one I should use.
Thanks
Chi

> > I have a combo box that listed the Department Names. I would like to create a
> > Print View button that will show only the Department which I selected in the
[quoted text clipped - 20 lines]
> If [Department] is a Number Datatype, then use:
> "[Department] = " & Me![cboDepartment]
fredg - 07 Jun 2006 18:21 GMT
> Hi Fred,
> Thanks for your respond. I have tried to apply the code to the form.
[quoted text clipped - 30 lines]
>> If [Department] is a Number Datatype, then use:
>> "[Department] = " & Me![cboDepartment]

Did you change "ReportName" to the actual name of the report you wish
to open?
Did you change [Department] to the actual name of the field in the
report's recordd source?
Did you change [cboDepartment] to the actual name of the combo box on
the form?
Did you use the Text or Number datatype syntax as explained in my
previous message.

A copy of YOUR exact code would have been helpful.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
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.