Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Reports

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-23-2009, 07:12 AM
Lockrin Lockrin is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: Dec 2009
Posts: 52
Lockrin is on a distinguished road
Default Automatically choose which report?

I have 3 (as of right now) different reports that need to be run from the same data in a table. These reports are very similar but vary based on one value in the table. Field "Type" can have one of 3 values: "Flat Oval", "Round", or "Rectangular". I have a form with a button to run a report, but I need it to choose which report to run based on this value.

I thought about using an IIf statement but I don't know if I should put it in the onclick of the button or how to structure it.

Thanks in advance for any help.
Reply With Quote
  #2  
Old 12-23-2009, 08:28 PM
maximus's Avatar
maximus maximus is offline Windows XP Access 2003 (version 11.0)
Wizard
 
Join Date: Aug 2009
Location: India
Posts: 804
Blog Entries: 1
maximus is on a distinguished road
Default

let me get this straight you have a certain condition that is available on the form and based on that condition u would like to open a specific report try this. suppose the condition is in a textbo1.

if me.textbox1=Condition1 then
docmd.openReport ReportName1
elseif me.textbox1=Comdition2 then
docmd.openreport ReportName2
else
docmd.openreport ReportName3
end if

it is not clear whether you want to open the reports view particular reports if so you have to add a criteria if u need 2 do that please let me know. if this solves your problrm please mark this thread as solved
Reply With Quote
  #3  
Old 12-28-2009, 11:41 AM
Lockrin Lockrin is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: Dec 2009
Posts: 52
Lockrin is on a distinguished road
Default

That wasn't exactly what I needed but it did get me on track enough to figure the rest out. Thank you very much, the exact code I used was

If Me.Type = "Round" Then
[Round].Visible = True
[Rectangular].Visible = False
[Flat Oval].Visible = False
ElseIf Me.Type = "Rectangular" Then
[Round].Visible = False
[Rectangular].Visible = True
[Flat Oval].Visible = False
ElseIf Me.Type = "Flat Oval" Then
[Round].Visible = False
[Rectangular].Visible = False
[Flat Oval].Visible = True
Else
[Round].Visible = False
[Rectangular].Visible = False
[Flat Oval].Visible = False
End If

P.S. I will try to mark it solved but am not 100% sure how to
Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I choose a record from a list and it populates a form? dalanengle Access 3 09-26-2009 11:57 AM
How do i automatically generate #'s not starting with 1??? fairygirl85 Queries 9 04-28-2009 03:42 PM
Have database open automatically Norman Masson Access 6 01-08-2008 04:41 AM
How do I choose multiple records for a report admaldo Reports 2 03-03-2006 03:02 AM
automatically create queries GEORGIA Programming 8 01-23-2006 11:35 AM


All times are GMT -8. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.