Unbound Controls and Form Dirtiness

shacho

New member
Local time
Tomorrow, 04:27
Joined
Jan 1, 2013
Messages
4
Greetings! If anyone can give me some suggestions for this project I would be very grateful.

I have a form that mostly uses unbound controls for data entry. When saving, I pick up the values, validate, and write them to their related fields in the form's BeforeUpdate event. This works well for new records, but not for edits, because BeforeUpdate doesn't fire unless the form is dirty. Changing unbound controls doesn't not make a form dirty, so the edits get ignored on save.

I'm not sure what the best solution is for this. I guess I could use each control's AfterUpdate to write the values directly into the fields, but that would be far less efficient than doing it all in the form's BeforeUpdate event.

Any suggestions?

Shacho
 
I have to start by asking why you feel you need to use unbound controls?
 
Great question. The only reason I'm doing this is because I want the values in the controls to persist. This form is used for entering hundreds of records at a stretch. The paper records are organized in advance so 80 or so at a time will have mostly the same values. Persistent values in the controls speeds up entry substantially. The way I did this on a previous project was to have a second set of unbound "default value" controls. That works but requires a lot of real estate.
 
That's clever! Cycling back into old records would destroy the defaults, but I suppose I could make the property write conditional on the form being in new record mode. That should work. Thanks for the tip!

shacho
 
Bingo! You catch on quick. Glad we could help.
 

Users who are viewing this thread

Back
Top Bottom