Mar 25 2005, 11:48 AM
I was hoping someone could assist me with validating date information. I have a database that tracks complaints. Basically, there are two date fields, one for the date the complaint was received, and one for the date the Investigation was completed. As I am looking through the 4600 records in this database, I am seeing that there are approximately 160 records that have a complaint received date that is after the Investigation completed date.
I would like for the data entry clerks to receive a message box that tells them this "The Investigation Completed Date must be greater than the Complaint Received Date". This should occur after they entered the Invvestigation Completed Date and it is prior to the Complaint received date...
Can anyone tell me where this should be done and how changing this will affect the data already in the database?
Mar 25 2005, 11:55 AM
In the AFTER UPDATE event of the Completion date control use:
IF Me!txtCompDate < Me!txtOpenDate Then
MsgBox "Competed Date cannot be earlier then Open Date!", vbOkOnly
Me!txtCompDate = Null
Note,, you can't Set Focus if the control already has focus, but once the After Update is completed it would change the focus, that's why I set the focus to another control first. The result should be that after they press OK on the message, the date they entered will erase and they will be back in the control.
Mar 25 2005, 12:11 PM
THanks! When I put that code in I received the following message:
The expression AfterUpdate you entered as the event property setting produced the following error: Ambiguous name detected: print_Click.
I double checked the spelling and spacing, so I am not sure what happened.
Mar 25 2005, 12:20 PM
Did you enter it as a Code expression? It sounds like there is already a click event module with a similar name.
Mar 25 2005, 12:29 PM
Yes, I entered it as a code expression. Where would I look to see if there is a click event module? When I look at the modules tab, it is empty. When I look through all the codes, I do not see one for the Investigation Completed Date other than the one I just wrote.
Pardon my ignorance, I have inherited several problem databases that were developed by other people and am having a heck of a time fixing some of them. I am just a little frustrated at this point; not to mention I am somewhat of a newbie to the whole development part of Access.
Mar 25 2005, 01:34 PM
What is the name of the module?
Should be Private Function controlname_After_Update or something like that.
Do a search thru the whole project for print_click.
Mar 25 2005, 03:25 PM
The search produced about 5 different codes with print_click contained in the code...
After looking further into the structure of the database, it really needs a lot of work.
I am going to drop this discussion and delve even further into the database. I thank you for your help! Rest assured, I will be asking lots of questions along the way.
There isn't even a consistent naming convention in the tables....Oh my...
Mar 25 2005, 03:55 PM
Mar 28 2005, 01:51 PM
Hope everyone had a nice Easter! Thanks for all your assistance. I have another question on this database, but I will post it in the correct forum.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here