Results 1 to 3 of 3
  1. #1
    Tim Bankerd

    Msgbox function needed. (Access 97)

    I have several text boxes on a form that users are putting either "N/A" or "n/a" or "none" into. If one of those entries is made, I want a msgbox to come up and tell the user to leave the box empty.I can't make a combo of them and limit to list, as there are many thousands of possibilities for each We have 10,000 + doors on our facility. I just don't want to have to go in and manually delete the N/A etc. .

    What I would like to do is have a function that would check all of the text boxes for the bad entries and apply that function to all of the "OnExit" events.

    See the attached Database for the exact details.

    Thanks for any help you can provide,

    Tim Bankerd

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Msgbox function needed. (Access 97)

    Actually, it would be better to use the BeforeUpdate event of each textbox to call a routine to test the contents of the activecontrol for the various strings they might have entered improperly. You would test for the strings like "N/A", "None", etc., rather than for the presence of a legitimate value. Then you can simply pop a message box to notify the user of the problem, and then set the Cancel argument to True in the BeforeUpdate event and reset the value of the textbox. If Cancel is set to true, they won't be able to leave the textbox with the erroneous value in it, and sooner or later they'll learn to stop putting that in.

  3. #3
    Tim Bankerd

    Re: Msgbox function needed. (Access 97)

    <P ID="edit" class=small>Edited by Tim Bankerd on 14-Sep-01 11:14.</P>Hey Charlotte,
    The syntax for this type of function is something I've not done before. Could you put an example that won't allow "N/A" in the DoorNumber box into the sample database on my first message? It would really help me a lot.
    NOTE: To gain access to the database window, you must first place a text file named "User.dum" into the same directory. After placing it, the SECOND time you open it using the shift key, it will then work.
    It's a nice piece of security code you might find usful.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts