I would like to have a data validating entry field that will basically force the user to enter valid information into the pop up text box. As opposed to allowing the user to enter garbage and then in turn spitting out garbage. Any Suggestions?
1. Input masks.
2. Can you limit the user's choices? i.e., if there are only a limited amount of things a user can put it, I usually place them in a table, and then put a combo box on the form that gets populated by linking back to the choices in that table. Then the user can only input the choices in the combo box, and the form will not accept anything but what populates that combo box.
does that make sense?
I am a nobody, and nobody is perfect; therefore, I am perfect.
Design Level
- Your database design schema will help ensure data integrity. For example, enforcing referential integrity for Invoice / Invoice detail records will prevent "orphans".
- Use correct data types, and reasonable limits. For example, when defining a field called FirstName, do you need a max of 50 characters. Likewise, you can set input masks.
- You can use unique indexes to prevent duplicate entries. But be careful with over use of indexes -- they create overhead.
Form Level
- Use the form and field properties window to set masks and default values.
- You can use code with AfterUpdate field event procedure to verify specifics
- Verify related data exists with functions such as DLookUp.
- You can use BeforeUpdate record event procedure to check all data before updating or inserting a new record for integrity.
User Friendly interface
Providing a simply, intuitive user interface will also help avoid data issues. For example, by using combo or list boxes, and search capabilties within a data entry form will minimize data entry errors. For example, for a regional contact database, you could use a combo box for the Street name. The end user starts typing in the name of the street, and the combo box fills in the rest entry for the user - this saves time, and minimizes typing mistakes.
For more info, use the Tek-Tips search feature, key word validation or related words. Here is a starter link...
Thank You, But in using the after update, doesnt the data get processed before the After Update is run? I want to be able to say to the user, invalid entry, without having garbage data sent.
You have event procedures that apply to the entire form. commonly used event procedures for the form are
- OnCurrent record
- BeforeUpdate record (validate here)
- AfterUpdate record
- OnDirty
- OnDelete
- OnLoad / Unload
You also have event procedures that apply to the fields on the form. Typical ones used are...
- AfterUpdate feild (validate here)
- OnDirty (can validate here too)
- OnClick / DoubleClick
- OnFocus
- NotInList
At the field level, you can cancel / reverse the entry, set the "focus".
For example, OnDirty is a property that is set to store the old value if a new value is entered. If the field entry is invalid, you can cancel which then restores the dirty / old value to the field. You would typically do this action using the AfterUpdate field event procedure.
Hey is there a way to popping up a Alarm message or prompt, instead of an Message box? My reason for asking is, i dont know visual basic code, but i want to use a before update that will check to see if such a record exist in my database, and if it does, than continue to display record, if it doesnt, than pop-up an alert saying there is no record. Instead of pulling up a blank report if invalid data is entered.
Beyond the design level and form properties, you pretty well have to get your fingers dirty with VBA or macros.
However, some of the basic stuff is actually quite easy -- the biggest leap is to get your toes wet with some simple coding. Once you gain confidence with some simple stuff, you will see "how" it works, and can move on.
Post details on one field on one form that you need help with, and "we" will see what we can do. What is the purpose of the form, purpose of field, name of field...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.