Results 1 to 4 of 4
  1. #1
    tonygg is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    115

    Passing a Field Value to VBA Procedure

    Sorry to be asking a very dumb question but ...

    I have a form displaying the contents of a table in a datasheet view. I want to click on a row and open up a new form that will use a field in the selected row as a parameter.

    I know how to call the VBA procedure by setting the double click on field (Cant do it for click on any fields in the row?) and in the VBA was using:

    strText = Me.[Product Reference].Value



    to get the required value. However this only seems to work in single form view. If it is in datasheet view it gives an error and will not let you save the form.

    I am guessing I am missing the row identifier in my VBA code. I have tried to search on the forums but I am obviously not using the right VBA speak as I cant find an example.

    Please could someone help me out?

    Many thanks Tony

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That should work. What is the error? Is this what you're trying to do?

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tonygg is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    115
    Thank you. That helps. I got the syntax wrong. It works now.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Passing Form Field Value to Query
    By calgarianguy in forum Forms
    Replies: 1
    Last Post: 06-11-2013, 09:35 PM
  2. Replies: 2
    Last Post: 08-29-2012, 08:01 AM
  3. Replies: 2
    Last Post: 05-06-2012, 03:52 PM
  4. Passing a NULL value to a date field
    By lman in forum Queries
    Replies: 2
    Last Post: 02-22-2011, 02:20 PM
  5. Passing variable values to Stored Procedure
    By rodrigopcnet in forum Access
    Replies: 1
    Last Post: 04-14-2010, 10:35 AM

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