+ Reply to Thread
Results 1 to 3 of 3

passing values

  1. #1
    Registered User
    Join Date
    03-02-2007
    Posts
    28

    passing values

    Here is what I mean. If I have a routine that gives me a temp value of a record, FIND where C.select matches the criteria the user is looking for.
    I then need to pass this value onto another routine "UPDATE" to the record can be updated.

    In my FIND routing I have the value of C. SELECT to show my current record match, I then need to update the record with my UPDATE routine.

    How can I put UPDATE on the same record as FIND? the problem I am having is find work independently from UPDATE so Update is not at the same record as find.

    Any help would be appreciated.
    Daniel

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Daniel,

    In VBA values are passed two ways: by value (ByVal) or by reference (ByRef - this is the default). By value creates a copy of the object in memory for private use by the calling routine. By reference passes the object address (pointer) to the object itself. This allows you to directly interact with object without copying it first.

    If your Find routine is searching a range then it will return a range object if successful. You can pass this ByRef to another routine to modify those same cells directly. If you want to do some trial manipulation of data, you can pass it ByVal. The changes made on this data won't affect the original data.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-02-2007
    Posts
    28

    Thank You

    Leith,

    Thanks for the explanation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1