D
doyle60
I have a report that has a control on it that should read "Customer
Social Compliance (CSC) is required" if a field has data in it (the
name of the person taking care of the issue). The field appears to be
a name but is truly an autonumber ID.
So I put this in the Control Source:
=IIf([CSCRequiredName] Is Null,"","Customer Social Compliance (CSC) is
required.")
CSCRequiredName is a bad name, I should have used "ID". Sorry.
So it all actually works very well, except on one condition, and that
is when the record is newly created.
Here is the scenario: A person opens the form and fills out header
material and let's say does not touch the field in question, leaves it
untouched so it is null. Then he fills out data in a sub form, then
he jumps back and forth 10 times between header and sub. Then he
presses the command button that opens the report. The report opens
and it acts as if the field, CSCRequiredName, has data in it when it
doesn't and so the line "Customer Social Compliance (CSC) is
required." appears when it shouldn't.
If I close the form and open again, it works just fine, even when the
field in question is still untouched. If I fill out the field, it
works and if I make it null again, it works.
So somehow on the newly created record the field is not yet null but
in some state between null and unnull.
How do I solve this problem?
My usual solution to requery problems is to right code that places the
curser into the subform before opening the report. But that is not
the case here as my experiments show.
Thanks,
Matt
Social Compliance (CSC) is required" if a field has data in it (the
name of the person taking care of the issue). The field appears to be
a name but is truly an autonumber ID.
So I put this in the Control Source:
=IIf([CSCRequiredName] Is Null,"","Customer Social Compliance (CSC) is
required.")
CSCRequiredName is a bad name, I should have used "ID". Sorry.
So it all actually works very well, except on one condition, and that
is when the record is newly created.
Here is the scenario: A person opens the form and fills out header
material and let's say does not touch the field in question, leaves it
untouched so it is null. Then he fills out data in a sub form, then
he jumps back and forth 10 times between header and sub. Then he
presses the command button that opens the report. The report opens
and it acts as if the field, CSCRequiredName, has data in it when it
doesn't and so the line "Customer Social Compliance (CSC) is
required." appears when it shouldn't.
If I close the form and open again, it works just fine, even when the
field in question is still untouched. If I fill out the field, it
works and if I make it null again, it works.
So somehow on the newly created record the field is not yet null but
in some state between null and unnull.
How do I solve this problem?
My usual solution to requery problems is to right code that places the
curser into the subform before opening the report. But that is not
the case here as my experiments show.
Thanks,
Matt