Results 1 to 4 of 4
  1. #1
    msleelee is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    2

    Open form to specific record, error 3070

    I have searched many other discussion, but none of those solutions have worked.
    I created a search form that returns results in a list box. I would like to able able to db click the list box to open the Employee's File. However, the code from Bradly Web, even after modify for a string has not yet worked. I receive Error 3070 stating that EReID is not recognized as a valid field name or expression.

    EReID is autonumber primary key
    EmployeeRecord is the table I am attempting to open to the specified record
    TestTest is a textbox holding the eID from the listbox

    Below is the code

    Dim rs As Object
    Dim lngBookmark As String


    'set a variable to the current record


    lngBookmark = Me.TestTest


    'open the new form
    DoCmd.OpenForm "employeerecord"


    'take it to the selected record
    Set rs = Forms!employeerecord.RecordsetClone
    rs.FindFirst "EReID = '" & lngBookmark & "'"




    Forms!employeerecord.Bookmark = rs.Bookmark


    Set rs = Nothing

    Any help is apperciated

  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,522
    The error would imply that isn't a field in the form's record source. I'd confirm that first.

    Bradly web?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    msleelee is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    2
    OMG, Thank you SO Very Much!!!! That worked. I changed the name to what it is in the record source instead of on the form & that worked so perfectly!!!! You are so very much appreciated & yes I so spelled that wrong.

  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,522
    Happy to help, and welcome to the site!
    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. Open Form and Link To Specific Record
    By burrina in forum Forms
    Replies: 2
    Last Post: 12-17-2012, 11:09 PM
  2. Error 3070 When Navigating to a Record
    By Epidural in forum Access
    Replies: 1
    Last Post: 05-10-2012, 09:14 AM
  3. Open form on specific record
    By iky123 in forum Forms
    Replies: 1
    Last Post: 04-11-2012, 09:56 AM
  4. Open form to specific record
    By Two Gun in forum Forms
    Replies: 7
    Last Post: 11-09-2011, 10:00 AM
  5. Open Form to Specific Record
    By batowl in forum Forms
    Replies: 1
    Last Post: 04-08-2011, 10:10 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