PDA

View Full Version : Validation message box keeps reappering before the user makes a correct choice. Why?



wedd
01-24-2011, 09:20 AM
Hi all, I created a validation rule with a validation message box that pops up when a user selects an invalid entry. However, the pop -up remains after the user wants to make a correct choice. To resolve this the user has to close down the database and re-open it and when the user wants to amke a choice again the messagebox appears again. How can this be resolved that when the user makes the wrong decsion the pop-up appears so they can reselect the right choice with the messagebox appearing and re-appearing and ay worst close and re-open the databse?


Thanks for your contributions:friends:

CreganTur
01-24-2011, 10:26 AM
Without code this
post is meaningless

wedd
01-24-2011, 10:57 AM
Interesting! CreganTur, I know Access have expressions for this type of method. But would you know where I could research and find out about useful VBA code for validation rules? Thanks

CreganTur
01-25-2011, 06:34 AM
Sorry, I thought you were talking about a validation routine in VBA and had forgot to provide a code example.

What is the Validation Rule and provide an example of a correct choice the user enters.

wedd
01-25-2011, 06:52 AM
Validation Rule: = [schedule end time] > [schedule start time]

The user is suppose to select a later time than the start time. The end time and start time are on separate combo boxes

CreganTur
01-25-2011, 07:16 AM
Just to be clear- you have this set as a Validation Rule property of a field in your table that's connected to this form, correct?

hansup
01-25-2011, 08:31 AM
If you're talking about a Validation Rule in table design, you can't refer to other fields in a Validation Rule for a field. You can however compare fields with the Validation Rule available from Table Properties.

With 2 Date/Time fields, start_time and end_time, I can use this table validation rule to ensure the end_time value must be greater than the start_time.
[end_time]>[start_time]

wedd
01-26-2011, 10:20 AM
hansup, I wrote my validation rule on a form. Will it still work?

hansup
01-26-2011, 10:38 AM
If your form includes VBA code to do the validation, show us the code.