Results 1 to 8 of 8

Thread: [RESOLVED] Forms and functions

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2005
    Posts
    20

    Resolved [RESOLVED] Forms and functions

    Hi all

    I'm afraid I know the answer to this already, but...

    I have a user form that asks for a file to open. When the user clicks the browse button, a function creates a browse window and allows the user to select a file. The function returns the file name and path to the form (i.e. C:\DooDoo\stinky.dog). When the user clicks the "Open" button this file path is passed along so the program can do all sorts of inappropriate things.

    What I was wondering, is it possible to get a function to return multiple values? Ideally, I would have two variables, one for the path (C:\DooDoo) and one for the file name (stinky.dog).
    When you tell me that this isn't possible, how then do I split the two? I can't foresee using some string manipulations as the length of the path and file name will vary. Unless I did some sort of backwards string counting that split the string at the backslash before the file name.
    Oh bother.

    Is it possible to make a function hold an array?

    Oh yeah, I'm using a function because it was the only way I saw to get the values back to the form, other than public variables.
    !! I just has an epiphany... Perhaps I can set the two string values to the forms variables inside the function.. something like
    VB Code:
    1. frmPickaFile.strFilePath = strPathfromFunction
    I'll go try it out. While I'm doing that, anyone else have a suggestion??

    Super thanks

    Mike
    Last edited by GIS_Mike; Jul 27th, 2005 at 07:36 AM. Reason: I can't spell

Posting Permissions

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



Click Here to Expand Forum to Full Width