Results 1 to 2 of 2

Thread: Combo Box

  1. #1
    Join Date
    Oct 2003

    Unanswered: Combo Box

    Hi Guys,

    I have a combo box that I use to select and print specific reports. What I would like to do, is have a button that would select all and another that would clear the selection.

    I have a code in at the moment that says:

    Me.Val_Report_Specific.Selected(0) = True
    Me.Val_Report_Specific.Selected(1) = True
    Me.Val_Report_Specific.Selected(2) = True etc...

    However, as furter information is inputted into the table, the number of the rows continue to increase and I don't want to have to keep adding an extra line each time a new row is added.

    Is there an easier way that I could update this information? Perhaps a code that just selects All or none?

    Any help and suggestions will help immensly. Thanks in advance.


  2. #2
    Join Date
    Jun 2004
    Seattle, WA
    This may give you an idea
    Private Sub Command4_Click()
        Dim s As String
        s = DLookup("ShortName", "tblReports", "ReportID = " & lbReport.Value)
        DoCmd.OpenReport s, acViewPreview
    End Sub
    Private Sub lbReport_Click() 'Fills a txtbox you can ignore
     txtReports.Value = DLookup("Description", "tblReports", "ReportID = " & lbReport.Value)
    End Sub
    This is on a form. I have a listbox that has a nnicer looking name, Nicer meaning if I have a report called GetAllRecords it would display as: Get All Records in the listbox. I have a table that has ReportID (PK), ShortName, DisplayName, and Discription. The shortname field is name of the actual name of the report, and displayname is what you want the drop box to show.

    Let me know if it helps
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts