Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UnLoad Event and Primary Key Fields

Status
Not open for further replies.

ChemistZ

Programmer
Oct 30, 2001
70
0
0
US
I have a form in which I have put validation code into the UnLoad event. I am noticing something odd and wanted to know if anyone could help me with this. When I use code like If isnull(COUNTY_NO) then
MsgBox "blah blah blah"
Cancel=True

for fields that are not included in the primary key I have no problem with this code working properly but if I use the above code lines and it is checking for a field that is included in the key (by the way this form is built off of a table that has three fields making up the key) it does not even hit the lines instead it drops to the else clause which closes the form. I need it to stop and check the key to see if someone has purposely deleted information in any of these three fields. Can anyone explain or help?
 
Did you try the code on the Before Update event of the form?
 
Yes, I did but the form can still be closed with the X and that is what I am trying to put validation into and stop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top