Results 1 to 7 of 7
  1. #1
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16

    Angry #NAME? error in subform

    I have a main form that has a sub form.
    I had to change the table the sub form is getting data from I added a field.
    when I added this field to the sub form and used the sub form by itself it worked fine.


    but when I access the sub form inside the main form the new field show #name? in the test box that should display the value from the table. The field name is overrideprice so I know it it not a reserved word. I have tried removing the sub form and adding it back in. I am not doing any special code to load the sub form just getting the record from the table based on the order id select in the main form.
    Any suggestions?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Is the subform RecordSource a query? Did you add the field to the query?
    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
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16
    the source is not from a query. to add the field to the form I did a drag and drop. to add the field.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    That is odd.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16
    I am attaching a very cleaned version. to see the problem run the main menu form.
    then select the edit/view order
    select the buyer James T. kirk
    and the only order.
    you will see in the subform the field called override price has the #name?
    if you run [edit order_items subform] by itself it works just fine.
    Attached Files Attached Files

  6. #6
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16
    found it.
    I forgot that when I select the buyer and the order can get the order I have a section of code that sets the source code for the subform the magic of posting my issue on this forum strikes again.
    thanks for taking a look.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Look at the VBA in the Get_order button click event. It sets the subform RecordSource. It has not been modified for the new field.

    I avoid setting RecordSource unless absolutely have to. I prefer to set form Filter and FilterOn properties.

    EDIT: did not see your post
    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.

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

Similar Threads

  1. intermittent #ERROR in subform detail
    By jr2014 in forum Forms
    Replies: 7
    Last Post: 09-03-2014, 07:30 PM
  2. Replies: 2
    Last Post: 02-12-2013, 11:23 AM
  3. Error 3201 on Form / Subform
    By jerem in forum Programming
    Replies: 2
    Last Post: 12-01-2012, 12:34 AM
  4. Error with my subform
    By gcommservices in forum Forms
    Replies: 1
    Last Post: 12-29-2011, 01:47 PM
  5. Form and Subform error trapping
    By usmcgrunt in forum Forms
    Replies: 8
    Last Post: 09-12-2010, 11:54 AM

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