Results 1 to 9 of 9
  1. #1
    jgalloway is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2010
    Posts
    21

    Goto Record


    I have a subform on my account managers. This show my account manager information. Then I have a list of all the Sales Reps under that account manager which is in a subform. I want to click on that sales rep (field called enter or if you have a better idea). When I click on enter I want to be taken to that record. Right now it just takes me to record 1 and the the record displayed. It doesn't matter where that sales rep account manager is. It will only take me to record 1. Can you help please.

    I can upload the database if you want.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    You have an unbound combo or list box that lists the sales reps and when you select rep want to go to related record in subform? Why doesn't it work? You have code (macro or VBA) in the AfterUpdate event of the box or Click event of a button? Show that code for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jgalloway is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2010
    Posts
    21
    Quote Originally Posted by June7 View Post
    You have an unbound combo or list box that lists the sales reps and when you select rep want to go to related record in subform? Why doesn't it work? You have code (macro or VBA) in the AfterUpdate event of the box or Click event of a button? Show that code for analysis.
    I've tried a couple of ways. Nothing works. I tried GotoRecord and that didn't go to the correct record. It just goes to my first record in the sales rep form. Which I want it to open the sales rep form but also go to that specific sales rep. here is a screen shot.

    Below the page break line is the Sale rep. The column enter is were I want to click on to enter the sales rep and enter only that sales rep. Unless you know a better idea. I am open to anything that will work well.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Not really understanding the behavior you want to happen. You want to click on record in subform and then open another form for data editing? Need code to analyse.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jgalloway is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2010
    Posts
    21
    Okay sorry here. I don't have any codes anymore because nothing was working. The one code I was using just opened the sales rep form which was correct but it only opened it to the first record in sales reps.

    You see at the bottom of the account manager form is my sales rep in a subform. You can see the one column that says enter? That is where I want to click on and it will take me to the sales rep that is in that row. There will be several sales reps for just one account manager.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Easiest solution is to open the form filtered to the desired record by using WHERE argument. In the Click event of the Enter control (this could be a command button):

    DoCmd.OpenForm "form name", , , "ID=" & Me!SalesRepID

    ID is whatever field name in the opening form that corresponds to SalesRepID.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    jgalloway is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2010
    Posts
    21
    DoCmd.OpenForm "SalesRep", , , "Enter=" & Me!SalesRepID
    I used this with and without quotes.

    Gives me an error of "Microsoft Access cannot find the object 'DoCmd."

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Where did you put the code? Sounds like you put it in event property. This needs to go in a VBA code procedure. In the event property select [Event Procedure], double click the ellipses (...), this will take you to the procedure in the VBA editor. Type the code there.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    jgalloway is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2010
    Posts
    21
    Got it to work. Thank you!

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

Similar Threads

  1. Goto record in subform - sometimes
    By RasterImage in forum Forms
    Replies: 6
    Last Post: 09-13-2011, 04:36 PM
  2. list box goto record issue
    By Madmax in forum Access
    Replies: 2
    Last Post: 07-07-2011, 06:17 AM
  3. Replies: 1
    Last Post: 06-01-2011, 06:44 PM
  4. Goto a new record in tabbed subform
    By snoopy2003 in forum Programming
    Replies: 3
    Last Post: 03-05-2011, 04:24 PM
  5. Replies: 7
    Last Post: 12-13-2010, 03:12 PM

Tags for this Thread

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