Home | Business and Productivity Software | View Reports
Business and Productivity Software
Problem for Business and Productivity Software
Generic problem for all Business and Productivity Sof...

View Reports




By fabiola on Oct 28, 2007

" "
I have a database caled CMS.db.I have four reports namely rptenq,rptall,rptdept,rptlist.I have a main form called Main.My problem is i want to list my reports in a list box and give the user the ability to open the report in the main form.

Solution #1

posted on Oct 30, 2007
Not Rated)

SeaJade

Rank: Guru 
Rating: 87%, 190 votes
Hi, There a couple of different way you could do this and I have put two lots of VB code below that you can modify and use. Firstly you create the Combobox list by choosing the option that you will type the values yourself, you then type in all your report names on each line. After that you can then go to the VB code editor and paste my code in and modify it by changing my report names, (Customers) etc to your report names. Make sure you choose the Combobox and the On_Click option in the VB editor to paste the code into.  I like the first method better which checks the value of the Combobox and then opens the corrosponding report in the maximised form. The second method does the value check before running an assigned macro to open each report. With this you must first assign macros to each report in Access.  Remember each of these bits of code must be placed between the "Private Sub" heading and the "End Sub" ending, and change the "Combo23" name to reflect your combobox too. If you need a hand just email me.

First Method
 
If Combo23.Value = "Customers" Then
    DoCmd.OpenReport "Customers", acViewPreview, acWindowNormal
    DoCmd.Maximize
   
ElseIf Combo23.Value = "Customers 1" Then
    DoCmd.OpenReport "Customers1", acViewPreview, acWindowNormal
    DoCmd.Maximize
   
ElseIf Combo23.Value = "Customers 2" Then
    DoCmd.OpenReport "Customers2", acViewPreview, acWindowNormal
    DoCmd.Maximize
   
End If

Second Method
 
If Combo23.Value = "Customers" Then
   DoCmd.RunMacro "Macro1"
   DoCmd.Maximize
ElseIf Combo23.Value = "Customers 1" Then
    DoCmd.RunMacro "Macro2"
    DoCmd.Maximize
ElseIf Combo23.Value = "Customers 2" Then
    DoCmd.RunMacro "Macro3"
    DoCmd.Maximize
End If
Was this helpful?
Yes
No

Popular Solutions for Business and Productivity


Questions and Unsolved Problems for Business and Productivity


Answer
My Quicken 2009 Deluxe program shows HUGE fonts to the point I cannot see the entire page on my... (More)

Answer
my dvd and vidiowave says i need to activate mpeg-2 to use , won't let me activate on line or off.

Answer
When I change the origin of the object after unlocking the syncing of position and origin the object... (More)

Answer
I have one customer who's O/S debt is NOT included in the ''aged overdue receivables'' . when I go... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:







Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Browse popular Problems
More Common Problems
Most Common Problems for:
For Business and Productivity...:

Top Business and Pro... Experts

Rank: Guru Guru  

Solutions: 554
Member Since: October 2009

Experience: Experienced a lot in computer troubleshooting. Knowledgeable about cellular phones.

Ask Me
Find more Business and Pro... Experts

Top Computer & Laptop Repair

(952) 890-7770
Zkarlo.com provides discount and used laptop parts...
Zkarlo.com

(877) 729-0812
We connect to your computer over the Internet to...
Remote Repair


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

X
Continue
When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!
Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select