Results 1 to 4 of 4
  1. #1
    nevertool8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    5

    Closing a form


    I have a form (call it FORM A) with several fields on it bound to an underlying table (Call it Table A). One of the entry fields is a combo box, with its property set to Limit to List. When I type something into the combo box that is not in another table (call it Table B), it opens a new FORM (FORM B) which allows the user to enter the new piece of data which is then written to TABLE B. All of this, so far, works perfectly 100%. The problem is, after that entry is made on FORM B, I want it to return immediately and automatically to FORM A. Eventually it does, but I have to manually click on close two or three times (it re-displays FORM B) before it returns to FORM A. Once it does return to FORM A, the value that was entered on FORM B does in fact appear in the combo box, and all is well. But each time FORM B is called by the combo box on FORM A, I want it to be a one-time only entry before returning to FORM A. I've tried using an event code for Close Form and Close Window, but neither works. There must be some way, other than manually clicking a button, to have FORM B close automatically as soon as an entry is made, and then simply return to FORM A. Hope this makes sense. Thank you.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    should not have to click more than once to close form2 and go back to 1st form. Suspect either code is running that prevents that, or you have turned off warnings at some point thus you are not responding to a problem because there is no message. Either
    - look for code that turns off warnings and disable that and test again or
    - post enough code so that we can follow through the sequence of events involved or
    - post a zipped copy of your db. You may have to compact/repair it first, but you should always back up the db before doing so.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    nevertool8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    5
    Quote Originally Posted by Micron View Post
    should not have to click more than once to close form2 and go back to 1st form. Suspect either code is running that prevents that, or you have turned off warnings at some point thus you are not responding to a problem because there is no message. Either
    - look for code that turns off warnings and disable that and test again or
    - post enough code so that we can follow through the sequence of events involved or
    - post a zipped copy of your db. You may have to compact/repair it first, but you should always back up the db before doing so.

    Thank you. Your post made me look at my code for the not-in-list event (the code that calls FORMB), and sure enough, I had inadvertently loaded the form twice. As soon as I removed the duplicated line in the code, everything worked perfectly. Thank you again.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    glad you figured it out!
    good luck with your db

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

Similar Threads

  1. Closing a pop-up form?
    By drharb in forum Forms
    Replies: 3
    Last Post: 11-15-2016, 06:34 PM
  2. Replies: 6
    Last Post: 01-06-2015, 12:37 PM
  3. closing form
    By joshynaresh in forum Access
    Replies: 6
    Last Post: 02-05-2014, 09:06 AM
  4. Replies: 5
    Last Post: 12-22-2011, 01:12 PM
  5. Closing a form through VBA
    By ghostmachine in forum Forms
    Replies: 4
    Last Post: 12-13-2010, 01:57 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