NOT saving data when closing form

iommi

New member
Local time
Today, 13:51
Joined
Mar 10, 2000
Messages
6
I wonder how to close a form, using the
close event, without saving the data that are entered into the controls (txtboxes)?

I have tried to loop as many times as there are number of controls -1 on my form (starting on 0) and take the controltype (if accontroltype = acTextBox then...) and set it to null. But the err msg says that eather the
form is write protected (which is false in my case) or the value i try to set the control to (null) is to big. I use a dialog typ of form, but this is not supposed to cause any probs.

Please, email me suggestions.

/Axel Nilsson
 
I would run a delete query to remove the existing data in however many rows you want evacuated.

What is the function of your database? I think it's odd to have data entry then not commit the information. Are you using some kind of template? If so, the above will do what you want. Are any records ever saved? If so, we want to customize the delete to remove only data in that particular record.

Dave Mack Saratoga, NY
 
Hello

The purpose of the program is to randomise different patients, using block randomisation so they are optimally allocated to one of two groups. I am developing the program for a major hospital in Sweden, and the reason I asked was that if any person who runs the system fills in all the patient-info and NOT pushes the randomisation-button or function and then by mistake closes the form, the data in the controls in the form will be saved to the tables. The next time someone opens the system, there will be an unrandomised patient in the system - which will collapse the entire block randomisation, or the patient wont be able to be randomised again, even if it never was part of the randomisation..

Anyway: Thanks. I have now a dbengine(0)(0).execute ("delete...." in my onclose-event.

Many thanks

/iommi
 

Users who are viewing this thread

Back
Top Bottom