List Box Functions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FriskyDingo
    New Member
    • Mar 2010
    • 3

    List Box Functions

    I need to make a list box with 2 reports in it. Then i need to make a function that wil return the name of selected report, or if no report is selected then return "no report selected".

    After i made the list box i tried to make the function in the code builder: insert procedure -> function. I tried using an IF statement to make it that when a report is selected the report shows as in a msg... but it keeps saying something is wrong with my code. Any ideas? thx.
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Can you post the code that you have so far. Then we can help you out.

    Happy Coding,
    CroCrew~

    Comment

    • FriskyDingo
      New Member
      • Mar 2010
      • 3

      #3
      Ummmm Thats the things, i dont really know where to begin. This is what i have:

      In the code builder under the subform it says:
      Function ()

      End Function

      My book gives descriptions and examples on how to write code for a multipler or similar function, but nothing about how to make a selected item in a list box make a message come up. Maybe i cant connect the concepts. Can you still help?

      Comment

      • MrMancunian
        Recognized Expert Contributor
        • Jul 2008
        • 569

        #4
        Ouch, so basically you want us to write a complete function for you...

        Let me give you a few hints:

        - A Listbox has a property you might want to use, called SelectedItem.
        - A Select...Case statement allows you to check for different value possibilities. You might want to use that, although an If...Then...Els e statement would also suffice.
        - A Function always returns a value, so you might want to add 'Return' somewhere in your function...

        Think you can handle that?

        Steven

        Comment

        • FriskyDingo
          New Member
          • Mar 2010
          • 3

          #5
          thx exactly what i needed to get started. got this.

          Comment

          Working...