Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 3rd, 2008, 03:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Report Preview

I create two reports preview by using following two queries.
in MS office 2007

query-1

ELECT WORK_LOCATION.*
FROM WORK_LOCATION
WHERE WORK_STATUS='Pendiny';

query-2

ELECT WORK_LOCATION.*
FROM WORK_LOCATION
WHERE WORK_STATUS='Delayed';

I want to use only one query.
I want that when report run it ask work_status and user
insert Pending or delayed what ever value and report should
be preview.

In report property I change the control source value to

&WORK_STATUS

When report run it ask work_status
what more property will change in report property and what
change in above query ? so that by only one query
requried records will display ?

Thanks and regards
Mateen
  #2 (permalink)  
Old January 3rd, 2008, 05:50 AM
Authorized User
 
Join Date: Dec 2007
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In your query, under WORK_STATUS criteria type something like Pending or Delayed within [].So, when you run query you will be asked to type the required value and the query will be displayed accordingly.
  #3 (permalink)  
Old January 3rd, 2008, 06:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks you very much.

It is possible that when run report and it ask Work Status.
when it ask Work Status it display combobox ?

in row source and row source type use value list.
in value list give values.

by the combobox select the require value to preview the report ?

how can activate the combobox in preview report ? what property will change ?

Thanks and regards
Mateen


  #4 (permalink)  
Old January 3rd, 2008, 07:50 AM
Authorized User
 
Join Date: Dec 2007
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Iam not very sure whether combo box can be added in report.Instead you can add combox to "FORM" and filter the records which will display in report preview.
  #5 (permalink)  
Old January 3rd, 2008, 08:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for you response.
how can filter the records which will display in report prview ?

I use combobox in FORM, and
in control source give table name
in row source give "Delayed";"Pending";
in row source type select list value

can you send the steps/ properties will use to filter the records
when select the value from the FORM combobox it display records
in report preview ?

Thanks
Mateen






  #6 (permalink)  
Old January 3rd, 2008, 09:39 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I've made reports so that I link data to my report's query from form

Make your report based on a query and set criteria like this
[Forms]![FromName]![Status]

Status is a combobox in form



-vemaju
  #7 (permalink)  
Old January 3rd, 2008, 05:53 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Create your query as normal but do not put a criterion anywhere. Leave it blank so it gives you back everything.

In your form, create the combobox as you have already done.

When you click the open report button the from, the ON CLICK event should be something like

DoCmd.OpenReport "XXX", acPreview, , "[Status] = '" & Me.YYY & "'"

where XXX is the real name of your report and YYY is the real name of your combobox.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
  #8 (permalink)  
Old January 7th, 2008, 04:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your response

I try your code on click event like this

Private Sub Command38_Click()
DoCmd.OpenReport "work_location", acPreview, , "[Status] = '" & Me.WORK_STATUS & "'"

End Sub

but it is not opening the report preview and combobox
when I click the button for preview the report it nothing opening
not opening anything

any help please?

Thanks
Mateen




  #9 (permalink)  
Old January 7th, 2008, 09:30 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

You and I wrote

DoCmd.OpenReport "work_location", acPreview, , "[Status] = '" & Me.WORK_STATUS & "'"

work_location is the name of your report.
WORK_STATUS is the name of the control on the form

Is Status the name of the field in the underlying query or table for the report? If not, then it must be

DoCmd.OpenReport "work_location", acPreview, , "[XXX] = '" & Me.WORK_STATUS & "'"

Where XXX is the real name.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
  #10 (permalink)  
Old January 15th, 2008, 06:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your response.

yes
work_location is the name of report
work_status is the name of control source (work_status is the name of combobox in the form)

I use your code on button onclick event like this


DoCmd.OpenReport "work_location", acPreview, , "[Work_Location] = '" & Me.WORK_STATUS & "'"

like this alo

DoCmd.OpenReport "work_location", acPreview, , "Work_Location = '" & Me.WORK_STATUS & "'"


but no response, when I click the button, no movement, no report preview to ask work_status in combobox.

regards
Mateen




Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Preview mike0123m Excel VBA 0 August 7th, 2007 04:57 PM
Print preview scandalous Access 4 February 23rd, 2007 10:45 AM
PHP Preview anshul Pro PHP 1 January 5th, 2007 05:08 AM
Print Preview Report from ReportProcess cashman_at VB Databases Basics 0 November 2nd, 2006 09:14 AM
help in print preview star20010us General .NET 0 September 8th, 2006 07:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.