P
Peter Hallett
When entering data to a form, it is occasionally necessary to
programmatically reset a group of bound controls to their default values.
Sometimes the VBA runs as intended, and assigns the appropriate null or zero
values, but on others, and for reasons I do not understand, it falls foul of
the run-time error, “You can’t assign a value to this object.â€
I have also tried:–
Me.Control = Me.Control.DefaultValue
but that works no better.
Neither does a requery offer a solution. This would unnecessarily, and
inappropriately, rerun much of the form’s VBA.
I have encountered this problem in other situations, where data is accepted
when entered manually but rejected when entered programmatically. If I
understood the nature of the error I might be able to get around it but, at
the moment, I am stumped.
programmatically reset a group of bound controls to their default values.
Sometimes the VBA runs as intended, and assigns the appropriate null or zero
values, but on others, and for reasons I do not understand, it falls foul of
the run-time error, “You can’t assign a value to this object.â€
I have also tried:–
Me.Control = Me.Control.DefaultValue
but that works no better.
Neither does a requery offer a solution. This would unnecessarily, and
inappropriately, rerun much of the form’s VBA.
I have encountered this problem in other situations, where data is accepted
when entered manually but rejected when entered programmatically. If I
understood the nature of the error I might be able to get around it but, at
the moment, I am stumped.