Results 1 to 5 of 5
  1. #1
    laavista is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    42

    Open form and go to specific record based on a variable


    I have two tables and two separate forms. [ID] is the link between them. (I cannot do a subform in this case).

    Form1 displays 3 records
    Have control button that goes to Form2 where [id] = NumID (NumID is "long" variable)
    Have control button on Form2 to go back to Form1. It needs to go to the same record it came from. I don't want use a where clause (e.g., where [id] = [id]). This works, but the form1 is now filtered. I need all records available in Form1, but I want to go to the record it was on when the button was clicked to go to form1

    Example:
    Form1, record1, ID=30
    Form1,record2,ID = 35
    Form1,record3,ID = 40

    Select record3,ID=40, then click on button to go to form2 (has where clause where ID=40).
    Form2 is filtered and is correct.

    Click on button to go back to form1. No Filter. It goes to 1st record (record1,ID=30). I need all records displayed, but need to be on record2,ID=35.

    I really need your help. I've spent hours researching and tried many things with no luck.
    Thanks, in advance.

  2. #2
    kimmer is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    100
    If this is what you need, thank pbaldy.

    http://www.baldyweb.com/Bookmark.htm

  3. #3
    laavista is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    42

    It works!! and one follow-on question

    WOW-- this is great. This is exactly what I was looking for. I worked 3+ hours trying everything I could to no avail. I REALLY appreciate you taking the time to respond.

    One more question?

    How would I use a variable for the form name in the code you provided? If I can't do this, I'll use a workaround with if statements, but it would be much easier if I can just use a variable.

    THANKS AGAIN.

  4. #4
    ardalan2002 is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2012
    Posts
    1
    Quote Originally Posted by kimmer View Post
    If this is what you need, thank pbaldy.

    http://www.baldyweb.com/Bookmark.htm
    THIS LINK SEEMS TO BE A DEAD LINK.
    I have the same question but can not open it.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It is still a good link, at least it works for me. If you still can't get to it I'll copy the page here.
    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. Replies: 1
    Last Post: 04-11-2010, 04:05 AM
  2. Replies: 3
    Last Post: 01-14-2010, 08:32 AM
  3. Replies: 7
    Last Post: 11-29-2009, 01:44 PM
  4. Open to specific form
    By ecpike in forum Forms
    Replies: 2
    Last Post: 06-12-2009, 08:32 AM
  5. Need help - Record set based on a program variable
    By ericargent in forum Programming
    Replies: 1
    Last Post: 09-19-2007, 08:57 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