"report" form

unclefink

Registered User.
Local time
Today, 07:40
Joined
May 7, 2012
Messages
184
I've searched this only to find responses dated more than about 4 years ago and not exactly working for my issue, so hopefully someone here can help me out.

I have a form with a combo box listing all my report names who's name is reportlist

the row source for this combo box is as followed:

Code:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "termination report") AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

There are two things i'd like to do.

1. How would I go about using this same "query" embeded into the combo box in order to create a second column so the names of the reports are more user friendly.

2. Now that I have the combo box set up, minus the user friendly wording of it, I need to create three buttons that point at that combo box to do one of three things.

Print, email, or save as

I currently have a form with a button for every report to open, email, and save as which is literally crowding the form and making it unappealing, not so eye friendly either.

Can anyone help.

thanks in advance.

Much appreciated.

David
 
Where should the "more user friendly" name/text come from?
Create 3 buttons in the form, place a click event under each button.

Here is an example code to print a selected report in the combo box with the name "ComboBoxReportName", the buttons name is "PrintReport".
Code:
Private Sub PrintReport_Click()
  DoCmd.OpenReport Me.ComboBoxReportName, acViewNormal 
End Sub
 
Where should the "more user friendly" name/text come from?
Create 3 buttons in the form, place a click event under each button.

Here is an example code to print a selected report in the combo box with the name "ComboBoxReportName", the buttons name is "PrintReport".
Code:
Private Sub PrintReport_Click()
  DoCmd.OpenReport Me.ComboBoxReportName, acViewNormal 
End Sub


I was thinking of somehow using the "Caption" of the report for the "user friendly part of this step. I found the above mentioned code in a post dated from several years ago so this process i'm trying to take may not be the way to go. In the gist of it, regardless of how do it, i just need populate a combo box with the names of reports. I've seen posts indicate they created a table for this purpose alone, but didnt go into explanation as to how they did that. Mentally; i'm trying to do it without creating more redundancy IE: additional queries and tables; however if this is the way to go, i'll go that route.

As far as the button code goes, your code you provided covers part 2, and confirms as working. I'm taking a vba class today, so hopefully I have some better undersatnding coming out of that. I overanalyze these processes way too much, making the process over complicated.

Thanks for the help, much appreciated.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom