• Keep user in form (2000)

    • This topic has 4 replies, 2 voices, and was last updated 21 years ago.
    Author
    Topic
    #405583

    The user must fill in one or both of two special fields (call them FieldA and FieldB) but may not leave them both blank. How can I keep the user from leaving this form until this condition is satisfied? I can trigger a cautioning message when they leave the form – but by that time, the form is closed. I need to trigger the message if they TRY to exit and before the form closes.

    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #834429

      See the attached zipped database. A boolean variable is used to keep track of whether the form can be closed. (The demo actually does a bit more – it also forces the user to use a “Close” command button to close the form, not the x in the upper right corner of the form.) With the form open in design view, select View | Code to see the VBA code used.

    • #834430

      See the attached zipped database. A boolean variable is used to keep track of whether the form can be closed. (The demo actually does a bit more – it also forces the user to use a “Close” command button to close the form, not the x in the upper right corner of the form.) With the form open in design view, select View | Code to see the VBA code used.

    Viewing 1 reply thread
    Reply To: Reply #834430 in Keep user in form (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel