Again:
"Can you share some table structures? Do you realize that a text box
using an expression like =Right([myfield],4) can't be named "myfield"?"
Also, is it possible the DependentSSN field might be Null? If so, try:
=IIf(Len(DependentSSN & "") >4,Right(DependentSSN,4),Null)
--
Duane Hookom
MS Access MVP
--
I the header there are text controls that list the primary account
holder
and includes the SSN. For example
Name: [firstname]
SSN: [SSN]
Spouse:[spousename]
SSN: [SpouseSSN]
Then in the detailed section the dependents are linked to the primary
account holder through another table. The primary account holder can
have
more than one child. Listed in the detailed section there is only 1
text
box
for dependents and their SSN, when the report is generated the SSN
appears
for all the dependents. But I only want the last 4 to show.
=right([DependentSSN], 4) does not work , I get #Error.
But this function does work for those in the header.
:
Can you share some table structures? Do you realize that a text box
using
an
expression like =Right([myfield],4) can't be named "myfield"?
--
Duane Hookom
MS Access MVP
--
My apologies to all, I wasnt clear enough. The dependents are
listed
individually in te detailed section. When I apply the right
function I
get
an error code. I am guessing the reason for this is because there
are
multiple SSNs for multiple dependents. When there is just one SSN
to
work
with like (myssn and spousessn) the right function works fine. I
need
a
code
that will now that there are more than one dependent listed and can
block
the
first 5 digits of the ssn.
:
If you are asking the question, you are storing the dependent's
information
improperly. Each dependent should be stored in a single record so
there
would be no problem. You would use the same Right() function. If
dependent's data is mushed together into a single field, you would
need
to
separate the entries, apply the Right() function to each individual
SSN,
and
then concatenate them again for display. There are no shortcuts
for
bad
table design.
If you are in a position to change the design, now would be a good
time.
You would add a small subform to the mainform to input dependent's
first
name, last name (remember they may be different), and SSN.
"Built-in functions" <Built-in
[email protected]>
wrote
in
message I have an Access Report where I would like only the last 4-digits
of
the
SSN
to show when printing. I have already used the function:
=right([myssn],4)
=right([spousessn],4)
But the problem is for the dependents, there is more than one.
What
function do I use for that?