Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    18

    Question Unanswered: Question on making a dropdown work

    Hope this is an easy one.

    When selecting an item from a dropdown box, I would like an excel sheet to open depending on which item is selected from the dropdown box.

    As an example, if InStore is selected from the dropdown then open the InStore.xls, If Warehouse1 is selected from the dropdown box the Warehouse1.xls opens and if Warehouse2 is selected from the dropdown box then the Warehouse2.xls opens.

    Hope that makes sense.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    First thing I would do is add the Filename to the Location Table

    Will Make it Easyer Load the Right Excel File


    code came from microsoft web site
    Code:
    Sub OpenXLWorkBook(Path As String)
        Dim xlobj As Excel.Application
       
        'Check to see if the file name passed in to
    
        'the procedure is valid
        If Dir(Path) = "" Then
            MsgBox Path & " isn't a valid path!"
            Exit Sub
        Else
            Set xlobj = CreateObject("Excel.Application")
        
            'You do not need to make the application object visible
            'if you close the file and quit the application
            'later in your code in order to remove these objects
            'from memory.
        
            xlobj.Visible = True
    
            xlobj.Workbooks.Open Path
        End If
    End Sub
    Last edited by myle; 03-22-04 at 20:36.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7

    have a look

    have a look at the attachment

    This Time Sorry about that
    Last edited by myle; 03-22-04 at 23:02.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  4. #4
    Join Date
    Mar 2004
    Posts
    18

    Re: have a look

    Thanks for the above info. Tried the zip file but it's empty.

    Originally posted by myle
    have a look at the attachment

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7

    This Time

    Here
    Attached Files Attached Files
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

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