Results 1 to 2 of 2
  1. #1
    Degs29 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    38

    Code no longer working now that form is subform

    I created a form with the following code:



    Private Sub Item_AfterUpdate()
    Me.Description = DLookup("[Description]", "RMList", "RMList.[Item] = Forms![RMS]![Item]")
    End Sub

    This worked fine. Yes, I understand it doesn't follow normalization rules (I'm going to fix that shortly). The user would select an item from the list, and its description would be autofilled in the next field (I'm going to change that so it merely is displayed).

    However, now I've implemented that form as a subform for another form. The code no longer works and I'm getting "runtime error 2001" and I was interested in knowing why.

  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,521
    The syntax changes when it's a subform:

    Forms Refer to Form and Subform properties and controls

    but you may find this cleaner:

    BaldyWeb - Autofill
    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: 2
    Last Post: 05-29-2013, 01:44 PM
  2. Replies: 3
    Last Post: 01-16-2013, 02:53 PM
  3. Print button no longer working
    By kris335 in forum Programming
    Replies: 6
    Last Post: 09-28-2012, 08:56 PM
  4. Login form code not working
    By dharmacloud in forum Forms
    Replies: 11
    Last Post: 08-22-2011, 03:08 PM
  5. Simple Nav Form Code Not Working
    By alsoto in forum Forms
    Replies: 10
    Last Post: 04-10-2009, 09:30 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