which control dirty a form

  • Thread starter Thread starter tim johnson
  • Start date Start date
T

tim johnson

I have a bound form and subform. There are many codes
underneath these form. If open the form and I use
Access navigation system to move from record to the next
during the process the form gets dirty.

This causing me grief and compounded by me not being able
to identify which CONTROL is making the form dirty.

How can I find out which control it is?.

I am using Access 2000.

Thanks
 
tim johnson said:
I have a bound form and subform. There are many codes
underneath these form. If open the form and I use
Access navigation system to move from record to the next
during the process the form gets dirty.

This causing me grief and compounded by me not being able
to identify which CONTROL is making the form dirty.

How can I find out which control it is?.

I am using Access 2000.

Thanks

Navigation alone cannot dirty the form; therefore, it must be code that
is running in an event. If you're using the built-in navigation
buttons, it can't be code behind those buttons, because there isn't any.
It's not clear from your question whether it's the main form or the
subform that is becoming dirty, and which form it is that you are
navigating when it occurs. Likely events where code might be running
are the Current event (for the form being navigated) and the GotFocus
event of the control that is first in the tab order on the form being
navigated.

One could write code to loop through the bound controls on a form and
find out which one has a difference between its Value property and its
OldValue property. It seems simplest, though, simply to put breakpoints
in the forms event procedures and trace the flow of control as you
navigate.
 
Dirk,

For what it's worth, could I back up what you say ...

However, could I caution against the suggested compare loop and endorse your
'plan A' of breakpoint and single-step.

The reason being that recently I encountered a problem similar to the OP's
where a bound control was being (in effect) set to its current value (in, as
you suggest, the OnCurrent event), and that action was enough to trip Dirty.

Pardon the intrusion.
CD
 
Chadlon said:
Dirk,

For what it's worth, could I back up what you say ...

However, could I caution against the suggested compare loop and
endorse your 'plan A' of breakpoint and single-step.

The reason being that recently I encountered a problem similar to the
OP's where a bound control was being (in effect) set to its current
value (in, as you suggest, the OnCurrent event), and that action was
enough to trip Dirty.

You're right -- I'd forgotten about that, even though I've used just
that techniqe to forcibly dirty a form without changing any values.
Thanks for the reminder.
 
Back
Top