Results 1 to 3 of 3
  1. #1
    Phoenyxsgirl is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Location
    Joplin, MO
    Posts
    48

    Coding newbie

    I found this code for the AfterUpdate field on a report so that I can pull up the record relating to the Primary Key that was entered.

    Here is the link:
    http://access.mvps.org/access/forms/frm0005.htm

    here is the code:

    '****** Code Start *********
    'Move to the record selected in the control
    Me.RecordsetClone.Findfirst "[ID] = " & Me![ComboOrListboxName]
    Me.Bookmark = Me.RecordSetClone.Bookmark
    '******* Code End *********



    Unfortunately I'm still such a beginner when it comes to code, I don't know how to translate this to my database.

    So, the report is based on the table Participants. The primary key field is AppID. AppID is a Combo box.

    I want to enter in the AppID and if it matches a record, pull up that record. If it doesn't match, allow a new record to be created.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The example is code for a form not a report.

    Use the AfterUpdate event of combobox on form. With form in design view, select the combobox, go to the Events tab of the properties dialog, select [Event Procedure] in the AfterUpdate property, double click the ellipses (...) to open the VBA editor. You will be in the procedure, 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.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I found this code for the AfterUpdate field on a report
    There is no 'after update' event in a report. The event may be available to you but nothing is updated in a report. Are you talking about the after update event of a FORM?

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

Similar Threads

  1. Complex Coding --> Please Help
    By JFo in forum Programming
    Replies: 231
    Last Post: 11-03-2011, 01:20 AM
  2. Coding question
    By kzoli62 in forum Access
    Replies: 1
    Last Post: 07-04-2011, 05:09 PM
  3. Combo Box Coding
    By Hale in forum Forms
    Replies: 2
    Last Post: 05-04-2010, 10:56 AM
  4. Button Coding
    By yamie in forum Programming
    Replies: 3
    Last Post: 02-22-2010, 10:45 AM
  5. Bar-Coding
    By texasprincess7 in forum Access
    Replies: 1
    Last Post: 02-12-2009, 10:29 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