Results 1 to 3 of 3
  1. #1
    Asagi is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    1

    Code not firing after changing subforms SourceObject

    Hello and Good day.



    I have a Main Form composed of multiple text boxes (Name, ID, Address1 and Address2) to fill information, a single combo box and a SubForm (Named SubFormTest). Lets say I got a database with 3 tables (Labeled Tbl1, Tbl2 and Tbl3), each with the information of different people, the idea is to submit information on the Form's text boxes, but I would like to let the user to autofill if the data exists already, that is the purpose of the SubForm, with a OnClick event in the SubForm, I am able to fill the textboxes whenever the user clicks a row on the SubForm. The Combo's purpose is to change the SuBFormTest's SourceObject whenever the user changes its value, because the information might not exist in Tbl1 but in Tbl2 or Tbl3.

    At the start the OnClick event works perfectly, whenever the user clicks a row all textboxes are filled, the problem lies is when the user changes the value of the ComboBox, the table does indeed change the SourceObject to another table, but the OnClick event stops firing at all, even if I change the SourceObject to the original Table the SubForm displayed it won't work.

    I have tried to find a solution to this but can't really spot an answer, apreciated if it can be solved.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Can you post your database here?

  3. #3
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    "...purpose is to change the SuBFormTest's SourceObject..."

    This is fundamentally a bad design concept. I can't support assisting a novice in going in this direction.

    Consolidate tables and set up a classic Form / sub form design.

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

Similar Threads

  1. Replies: 4
    Last Post: 03-06-2015, 12:38 AM
  2. Changing iff into VBA code
    By masond in forum Access
    Replies: 1
    Last Post: 02-21-2014, 08:28 AM
  3. Changing order by using code
    By FRAZ in forum Queries
    Replies: 4
    Last Post: 01-22-2014, 12:54 PM
  4. Replies: 5
    Last Post: 10-11-2013, 04:33 PM
  5. Replies: 4
    Last Post: 05-18-2011, 03:24 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