IsNull Then "Message"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I usually do reports in Word and then Mailmerge from Access, so I am not at
all familiar with how reports work. I have read everything I can possibly
think of that would help me try and get this right but just can't seem to get
it right. I have a report based on query that shows MethodofPayment,
StatementClosingDate and MCReferenceNo. In the report when
StatementClosingDate isNull, I want to insert in that field the message "Not
MasterCard Charge" however, if the StatementClosingDate is not null then I
want the StatementClosingDate to appear. I have also read a million isNull
entries and am not even sure if I should use "" or isnull or isnot null. I
have tried Select Case, IIf statements, If . . . Then . . Else statements and
I basically don't know what I am doing. Not even sure where I would put the
code? In the report "on open" event? Any help is appreciated.

S
 
You can use a text box with a control source like:

=Nz([StatementClosingDate],"Not MasterCard Charge")
or
=IIf(IsNull([StatementClosingDate]), "Not MasterCard Charge",
Format([StatementClosingDate],"m/d/yyyy"))
 
As a matter of fact your name has been coming up all day. I think I have
read everything you have responded to in these discussion groups. I even
searched your name to see what else you had to say!!! :)

This worked out great and the message is showing up on my report. Not to
expect to much, but . . . can the message "take the place of" the null value?
If not, that is okay at least I have come a long way just getting the thing
on the report. Thanks! And have a great weekend. It is Friday, right?
--
S


Duane Hookom said:
You can use a text box with a control source like:

=Nz([StatementClosingDate],"Not MasterCard Charge")
or
=IIf(IsNull([StatementClosingDate]), "Not MasterCard Charge",
Format([StatementClosingDate],"m/d/yyyy"))

--
Duane Hookom
MS Access MVP

Sharon said:
I usually do reports in Word and then Mailmerge from Access, so I am not at
all familiar with how reports work. I have read everything I can possibly
think of that would help me try and get this right but just can't seem to
get
it right. I have a report based on query that shows MethodofPayment,
StatementClosingDate and MCReferenceNo. In the report when
StatementClosingDate isNull, I want to insert in that field the message
"Not
MasterCard Charge" however, if the StatementClosingDate is not null then I
want the StatementClosingDate to appear. I have also read a million
isNull
entries and am not even sure if I should use "" or isnull or isnot null.
I
have tried Select Case, IIf statements, If . . . Then . . Else statements
and
I basically don't know what I am doing. Not even sure where I would put
the
code? In the report "on open" event? Any help is appreciated.

S
 
I'm not sure what you are asking. Did you want to prompt the user for a
string to substitute for a null value?


--
Duane Hookom
MS Access MVP
(watching Monk while scanning photos of future daughter-in-law for craft
project and reading through news groups)

Sharon said:
As a matter of fact your name has been coming up all day. I think I have
read everything you have responded to in these discussion groups. I even
searched your name to see what else you had to say!!! :)

This worked out great and the message is showing up on my report. Not to
expect to much, but . . . can the message "take the place of" the null
value?
If not, that is okay at least I have come a long way just getting the
thing
on the report. Thanks! And have a great weekend. It is Friday, right?
--
S


Duane Hookom said:
You can use a text box with a control source like:

=Nz([StatementClosingDate],"Not MasterCard Charge")
or
=IIf(IsNull([StatementClosingDate]), "Not MasterCard Charge",
Format([StatementClosingDate],"m/d/yyyy"))

--
Duane Hookom
MS Access MVP

Sharon said:
I usually do reports in Word and then Mailmerge from Access, so I am not
at
all familiar with how reports work. I have read everything I can
possibly
think of that would help me try and get this right but just can't seem
to
get
it right. I have a report based on query that shows MethodofPayment,
StatementClosingDate and MCReferenceNo. In the report when
StatementClosingDate isNull, I want to insert in that field the message
"Not
MasterCard Charge" however, if the StatementClosingDate is not null
then I
want the StatementClosingDate to appear. I have also read a million
isNull
entries and am not even sure if I should use "" or isnull or isnot
null.
I
have tried Select Case, IIf statements, If . . . Then . . Else
statements
and
I basically don't know what I am doing. Not even sure where I would
put
the
code? In the report "on open" event? Any help is appreciated.

S
 
Exactly.
--
S


Duane Hookom said:
I'm not sure what you are asking. Did you want to prompt the user for a
string to substitute for a null value?


--
Duane Hookom
MS Access MVP
(watching Monk while scanning photos of future daughter-in-law for craft
project and reading through news groups)

Sharon said:
As a matter of fact your name has been coming up all day. I think I have
read everything you have responded to in these discussion groups. I even
searched your name to see what else you had to say!!! :)

This worked out great and the message is showing up on my report. Not to
expect to much, but . . . can the message "take the place of" the null
value?
If not, that is okay at least I have come a long way just getting the
thing
on the report. Thanks! And have a great weekend. It is Friday, right?
--
S


Duane Hookom said:
You can use a text box with a control source like:

=Nz([StatementClosingDate],"Not MasterCard Charge")
or
=IIf(IsNull([StatementClosingDate]), "Not MasterCard Charge",
Format([StatementClosingDate],"m/d/yyyy"))

--
Duane Hookom
MS Access MVP

I usually do reports in Word and then Mailmerge from Access, so I am not
at
all familiar with how reports work. I have read everything I can
possibly
think of that would help me try and get this right but just can't seem
to
get
it right. I have a report based on query that shows MethodofPayment,
StatementClosingDate and MCReferenceNo. In the report when
StatementClosingDate isNull, I want to insert in that field the message
"Not
MasterCard Charge" however, if the StatementClosingDate is not null
then I
want the StatementClosingDate to appear. I have also read a million
isNull
entries and am not even sure if I should use "" or isnull or isnot
null.
I
have tried Select Case, IIf statements, If . . . Then . . Else
statements
and
I basically don't know what I am doing. Not even sure where I would
put
the
code? In the report "on open" event? Any help is appreciated.

S
 
Try something like:
=Nz([StatementClosingDate],[Enter Text Here])

--
Duane Hookom
MS Access MVP


Sharon said:
Exactly.
--
S


Duane Hookom said:
I'm not sure what you are asking. Did you want to prompt the user for a
string to substitute for a null value?


--
Duane Hookom
MS Access MVP
(watching Monk while scanning photos of future daughter-in-law for craft
project and reading through news groups)

Sharon said:
As a matter of fact your name has been coming up all day. I think I
have
read everything you have responded to in these discussion groups. I
even
searched your name to see what else you had to say!!! :)

This worked out great and the message is showing up on my report. Not
to
expect to much, but . . . can the message "take the place of" the null
value?
If not, that is okay at least I have come a long way just getting the
thing
on the report. Thanks! And have a great weekend. It is Friday,
right?
--
S


:

You can use a text box with a control source like:

=Nz([StatementClosingDate],"Not MasterCard Charge")
or
=IIf(IsNull([StatementClosingDate]), "Not MasterCard Charge",
Format([StatementClosingDate],"m/d/yyyy"))

--
Duane Hookom
MS Access MVP

I usually do reports in Word and then Mailmerge from Access, so I am
not
at
all familiar with how reports work. I have read everything I can
possibly
think of that would help me try and get this right but just can't
seem
to
get
it right. I have a report based on query that shows
MethodofPayment,
StatementClosingDate and MCReferenceNo. In the report when
StatementClosingDate isNull, I want to insert in that field the
message
"Not
MasterCard Charge" however, if the StatementClosingDate is not null
then I
want the StatementClosingDate to appear. I have also read a million
isNull
entries and am not even sure if I should use "" or isnull or isnot
null.
I
have tried Select Case, IIf statements, If . . . Then . . Else
statements
and
I basically don't know what I am doing. Not even sure where I would
put
the
code? In the report "on open" event? Any help is appreciated.

S
 
Back
Top