Results 1 to 9 of 9
  1. #1
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    108

    combo box notinlist event code is on another plane??

    I have successfully used the NotInList event on several combo boxes to add new records to a table. But I have hit an issue with one.
    The new combo box successfully adds an empty record - just the key field populated. But this program does further processing after the NotInList has done its job to get further values for the new record.

    So I want to set a flag in the NotInList event to say "add more fields later". But the flag stays unset.
    The NotInList code doesn't pause if you set debug and it doesn't set the flag (a global variable).
    It is as if this code is on a different level and doesn't access any code around it (but it does add a record to the database)



    Weird????

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Have you tried stepping through the code at runtime to see what is happening?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    108
    Quote Originally Posted by Bob Fitz View Post
    Have you tried stepping through the code at runtime to see what is happening?
    It doesn't stop on the brown buttons - the rest of the code does ????

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by TOPSie View Post
    It doesn't stop on the brown buttons - the rest of the code does ????
    The rest of the code does what?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Do you have [Event Procedure] as the setting for the Not In List event property?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    So I want to set a flag in the NotInList event to say "add more fields later".
    Why later? Why not have the NIL event launch a form so all the info can be added at once?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #7
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    108
    Ahh the problem is I have several NotInList events for different comboboxes and my old eyes fooled me - I was putting the debug stop on the wrong box - which I didn't access - so all my fault

    Thanks for your help - I must try harder in future :-)

  8. #8
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    108
    I am adapting some old code which did all the collection of data an item at a time before writing the new record. My adaption is to constrain the first item requested (the key field) with the combo box. Hence this is now done (NotInList) before the other fields are gathered. if I was starting again I would rethink the whole thing :-)

  9. #9
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by TOPSie View Post
    Ahh the problem is I have several NotInList events for different comboboxes and my old eyes fooled me - I was putting the debug stop on the wrong box - which I didn't access - so all my fault

    Thanks for your help - I must try harder in future :-)
    Ha!! I know the feeling
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. NotInList Event Not Firing
    By mib1019 in forum Forms
    Replies: 17
    Last Post: 10-02-2020, 11:31 AM
  2. Combo, "NotInList" event doesn't fire
    By GraeagleBill in forum Programming
    Replies: 11
    Last Post: 06-14-2020, 05:50 PM
  3. How to execute NotInList code in combo box
    By vector39 in forum Access
    Replies: 6
    Last Post: 10-02-2017, 10:26 AM
  4. NotInList event
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 04-13-2011, 09:10 AM
  5. Cancelling the NotInList event
    By Remster in forum Programming
    Replies: 12
    Last Post: 11-21-2010, 10:12 AM

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