Results 1 to 4 of 4
  1. #1
    ivano64 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    2

    Notinlist routine preventing following routine from running


    I have a form with several controls and commands. In some combobox I have afterupdate and/or notinlist routines. The problem is that the users modify the data in the combobox and immediately after click on one of the commands, e.g. the one to update the subform. What I would like is that the notinlist routine prevents the command routine from running. How can I do that?

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    If I interpret your post correctly (and I'm not sure I am....) you have a user behavior issue. they type info then mouseclick on a command...

    so you need to trigger the check at trigger points that the user is triggering....try the OnExit of the combo box and/or also putting the check code into the command button before the subform update...you might tweak it with an if/then statement so the subform update does not fire if the NotInList routine is true.

    just general ideas, but the situation is common - where the user can act somewhat randomly and so the programmer must refine where tasks are triggered, often putting the code in multiple places in order to catch every possible variation the user might take. depending on what needs to be done - the form property of BeforeUpdate is often the best overall catch point...

    hope this helps.

  3. #3
    ivano64 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    2
    First of all, thank you for your reply. I try to explain better my problem. On the form I have several commands like: go to next record, close form, open word file, open another form and so on. So it is quite difficult to outguess which will be the next command that the user will click on. I thought about disabling the commands with the onfocus event of the textbox, but then I don’t know how to enable again the commands. Therefore I was wondering if there is some sort of VB function to stop the following routine. My idea was to write a code at the end of the notinlist routine that prevents the following routine from running. I don’t know if you understand better my problem, hope so.

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    in a mouse-centric world where users can/do jump around randomly - - if the app needs a linear set of tasks performed then one can manipulate the visibility or enable; both are properties of the control. enable allows the control to be seen but greyed out while of course visible is visible.

    this can force the user to do things in the proper steps in that they have no other choice....

    I don't really understand your post. In general for not-in-list; if the field property is in-list only; then not in list entry will cause an error message. it will trigger when the app knows that they are done entering. you can trap that error (a task to look up - a little more advanced) but one would think this error message will halt the user from advancing further; to slow down the user from mouse clicking another event before the error message consider keeping other controls not visible/disabled until the OnExit event of the list control. Users will press enter or tab to advance and that will trigger things

    hope this helps.

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

Similar Threads

  1. NotInList with Many to Many
    By SAC in forum Programming
    Replies: 17
    Last Post: 11-21-2010, 06:42 AM
  2. Replies: 0
    Last Post: 10-24-2010, 02:27 PM
  3. Contract Write Routine
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-31-2010, 05:15 AM
  4. Example Importing routine
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 12:35 AM
  5. applying a charge routine
    By rbrookes8dec in forum Access
    Replies: 1
    Last Post: 08-08-2010, 11:01 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