Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Function (Access 2000)

    I am trying to connect to an Excel spreadsheet from my switchboard.

    Function is defined as:

    Public Function OpenOtherDatabase(strName As String)
    Application.FollowHyperlink strName
    End Function

    In the Switchboard I have:

    OpenOtherDatabase("hmpg1015dept0199publicBlueChoic e_DatabaseWesternRegion_Oct.xls")
    (Disregard the name OpenOtherDatabase - I use it to open Word files, databases etc)

    When I click on the button on the switchboard for this

  2. #2
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Kenton, Delaware, USA
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Function (Access 2000)

    When I need to open another file from an access menu I usually just use a hyperlink.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Function (Access 2000)

    This function usually works. It works in my other databases. How do you use a hyperlink with a switchboard?

  4. #4
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Kenton, Delaware, USA
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Function (Access 2000)

    Open the switchboard in design view. Use the Insert|Hyperlink from the drop down menu and follow the prompts. It will drop the hyperlink onto your switchboard. Once the hyperlink is on your switchboard, edit the propereties to make it look like a command button. Then move it to where ever you want it.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Function (Access 2000)

    Is this a switchboard created with the Switchboard Manager? And did you put in an item with Run Program Code as item?

    If so, you'll have to modify the code behind the switchboard a little bit., for the Run Program Code action was not designed to handle functions with arguments. To remedy this, open the module behind the Switchboard form and search for the single occurrence of Application.Run in the HandleButtonClick function and replace it by Eval:

    Eval rs![Argument]

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Function (Access 2000)

    I have the notes from when you told me that before and I tried it and I got another error. When I got your reply, I tried it again and it worked. It is spooky how things work when I hear from you. My manager wants to hire you!!!

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Function (Access 2000)

    That is the magic of the Lounge! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    Glad you got it to work.

Posting Permissions

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