Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply With Quote
  #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.
Reply With Quote
  #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


Reply With Quote
  #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.
Reply With Quote
  #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






Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
  #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




Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.