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%, 189 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
ddy79-433jv-2rxgx-mqfqp-pfdh8 The above code worked. I had used Magic Jelly Bean but it only gave me... (More)

Answer
is textbridge 98 compatible with vista please?

Answer
how to integrate zinc6.1 with Tornado 2.2 IDE

Answer
I purchased and loaded expert pdf6.0 with very unfortunate results. Immediately after loading it I... (More)

Answer
i received no redundancy or owed holiday pay in my last wage,how do i write a letter of complaint to... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:





Sponsored Links



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: 437
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

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

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


       
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