Results 1 to 2 of 2
  1. #1
    chromachem is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    49

    vba doesn't recognize new control

    We have a form based on and associated with a table.



    On the form there is a textbox: txtSubContracted. It's control source is SubContracted (the name of the field in our table). The control source can be selected from the property sheet when designing our form.


    We want to put "Yes" in the SubContracted field of our table when certain conditions are met.

    The VBA code we run is:

    Me.SubContracted = "YES"

    The problem - in VBA we get "Compile Error: method or data member not found.
    In VBA when we type in Me. the list of available controls that may be selected opens. The control SubContracted does not appear.


    So... the control source SubContracted appears in the form design property sheet, but is is not available to select in VBA.

    What the heck???????????

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You want the name of the control, not the underlying field.
    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: 1
    Last Post: 12-16-2015, 08:15 AM
  2. Replies: 4
    Last Post: 05-22-2015, 02:29 AM
  3. VBA Outlook does not Recognize One or More Names
    By Ruegen in forum Programming
    Replies: 7
    Last Post: 12-06-2014, 12:02 PM
  4. Object Control doesn't contain border color
    By Ruegen in forum Programming
    Replies: 1
    Last Post: 11-25-2014, 05:02 PM
  5. Active X - Web Browser control doesn't work
    By forstatd in forum Reports
    Replies: 1
    Last Post: 06-02-2010, 10:56 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