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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Implementing new validation on existing records

Status
Not open for further replies.

061178

Programmer
Jul 7, 2005
41
GB
I have put in new validation on the itemchanged event of a field and in pfc_Validation which works well. But if an existing record is opened which fails the new validation check I am still able to save (as nothing has been changed.) Can someone suggest how I get around this? I could force the field to have been changed on open but then if the user navigates somewhere else the app will ask if they want to save changes, and they have not made any changes! Once again I think I need it on the before_save event but how do I create this event if there is no event_id? Thanks.
 
So you want to force the user to correct incorrect data even though they have not entered anything new in the datawindow?

You might try setting up an extra column in the SQL which makes up the datawindow. Then either set up a method which will loop through all rows in the dw to check for invalid data and set this column (and thereby the rowstatus) to force a message when the user closes OR set up an expression on the column itself which does the validation/setting of the column and then use the columns value to trigger the message/event to notify the user of the problem.

Matt

"Nature forges everything on the anvil of time
 
I only want the validation on exsiting records to be run when the user tries to save. If they don't try to save then they should be able to close the window without any message. This is why I was saying about the before save event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top