Results 1 to 2 of 2
  1. #1
    JayS. is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    2

    Click on datasheet cell copies value from another column to perform query

    Hello friends!



    I have a database and have hit a wall with an action that I need to perform.

    Essentially, when a records cell is clicked in datasheet view I need it to copy a value from another column in that record and store it for use in a query to return the appropriate items in another table.

    I think I can get all I need for the query, I'm just struggling with how to copy data from a record (in another column then the one clicked. I'm thinking it's an "on-click" event? The clicked cell is listed as a hyperlink to give it the appearance of a "clickable" item.

    In the example below, I want to click on the "Show List" link and copy the UserID value in the same line for use in a query to return only the items that pertain to that UserID.

    Click image for larger version. 

Name:	CopyAlternateFieldText.jpg 
Views:	8 
Size:	55.7 KB 
ID:	45601

    I appreciate your time.

    Jay

  2. #2
    JayS. is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    2
    Well, I figured it out and now feel silly. All I needed to do was create a string and reference the UserID field to load the value into the string.

    Code:
    Dim myUserID as string
    myUserID = Me.UserID.Value
    All good now!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-07-2015, 10:39 AM
  2. Retrieve Datasheet Cell Color
    By Dragon1966 in forum Programming
    Replies: 4
    Last Post: 09-30-2014, 07:59 PM
  3. how to format Datasheet view cell
    By selvakumar.arc in forum Forms
    Replies: 4
    Last Post: 07-02-2013, 02:05 PM
  4. Replies: 2
    Last Post: 11-29-2011, 05:26 PM
  5. Replies: 2
    Last Post: 11-18-2009, 06:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums