Combobox replace navigation tabs

ss6857

Registered User.
Local time
Today, 05:01
Joined
Jul 12, 2011
Messages
38
Hello, I'm going to try to be as detailed as possible without being confusing! I am using the latest version of Access. What I am trying to do is create a form that lists all the reports that I have made. When the user selects the report he wants, it previews the report. Then there will be checkboxes of options such as, convert to excel, convert to pdf, print, email, etc...

Before I get to the checkbox part, I'm having trouble with the first part. I use a navigation form and added an unbound combobox. The combobox does successfully contain all the report names with this code:

Private Sub Form_Load()
Dim ao As AccessObject
For Each ao In CurrentProject.AllReports
Me.Combo7.AddItem (ao.Name)
Next
End Sub

However it is not in alphabetical order and I would like it to be. My RowSourceType is set to Value List and my RowSource isn't set to anything because I didn't used a table or query to create my combobox. Is there something I can add in my code to make it alphabetical?

Also, in the original navigation form, if I click and drag a report to the tabs it would preview the report on the form. But because I have so many reports, having all those tabs would look busy and be less user friendly. So, what I want is if I click on a report in the combobox, I would like it to preview, but I can't seem to make that connection between the combobox and the subform/subreport.

Any suggestions? Thanks for any and all help!
 
With Row Source Type set to Tables/Queries, this in the Record Source Property of the Combobox will list all Reports alphabetically:
Code:
[B]SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") And (MSysObjects.Type)=-32764 ORDER BY MSysObjects.Name;[/B]

Remember to delete your original code for populating the Combobox.

Linq ;0)>
 
Check that part off my list! Thank you!
 

Users who are viewing this thread

Back
Top Bottom