Results 1 to 4 of 4
  1. #1
    Lesg is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    101

    Subform Control Reference syntax

    Hi Guys,



    I have a goods receipt form which has a combobox ( cboprodlist ) to select product to book-in. on the form is a button that opens up a form to add new products if they do not exists currently.

    When the new product is entered upon clicking the close button, I am wanting to requery the combox box on the goods receipt form so the new product is now available in the list, however, Ijust keep getting error message saying it cant find the field and is refereeing to the form

    I have tried using:

    Forms!frmGoodsReceipt!frmGoodsInSub.cboprodlist.Re query
    Forms!frmGoodsReceipt!frmGoodsInSub.Form!cboprodli st.Requery

    Can anyone suggest the correct syntax please?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Me.cboProdList.Requery

    Anyway, here is the syntax as well. http://access.mvps.org/access/forms/frm0031.htm
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    see this link for referencing controls in other forms

    http://access.mvps.org/access/forms/frm0031.htm

    your second example 'looks' right but perhaps you have more layers of forms?

    Always a good idea to rename controls so they don't match the object they contain - helps to resolve issues and avoid conflicts with names. So perhaps use GoodsInSubFrm for the control name rather than frmGoodsInSub

    Also make sure you have Option Explicit at the top of every module and compile your code before running to identify any compilation errors.



  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

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

Similar Threads

  1. Subform control reference
    By SunTop in forum Forms
    Replies: 3
    Last Post: 04-26-2017, 03:50 AM
  2. Reference Control on Subform Problem
    By McArthurGDM in forum Queries
    Replies: 1
    Last Post: 02-11-2015, 04:38 PM
  3. Make subform control reference with a string
    By dcdimon in forum Programming
    Replies: 2
    Last Post: 04-01-2014, 02:24 PM
  4. Replies: 1
    Last Post: 05-12-2011, 02:25 PM
  5. Can't reference control in subform
    By evanscamman in forum Forms
    Replies: 0
    Last Post: 12-25-2007, 06:47 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