Inline Coding "Format" function

  • Thread starter Thread starter Dave v.
  • Start date Start date
D

Dave v.

I am new to ACCESS and mostly self taught.
The following was extracted from an Access Report "Thank
you Letter" I am trying to create. It almost works the
way I want I to. A sample of the output follows the code
segment. The whole string is in a single text box.
I want to format [DonationValue] as $10,000, and I want
to format [DonationDate]as October 26, 2003, but I cannot
find a way to include the "Format" parameter in the
string. Can someone help with an example or tell me what
I need to modify to make the changes. Since my ACCESS
Unleashed book doesn't help; does any one have a
recommendatin for another reference source.

="Thank you for your " & IIf([DonationType]="Cash",
[DonationValue],[DonationType]) & " donation on" & " " &
[DonationDate] & "." & " " & [FirstName] & ", " & "it is
your continued support, along with additonal donors like
you that makes New Options the success it is."

Thank you for your 5000 donation on 10/24/2003. Jane, it
is your continued support, along with additonal donors
like you that makes New Options the success it is.


Thanks for the help!
D.K. van Wagenen
 
If you have several different donation types, you could create a function
that would accept parameters of DonationType and DonationValue and returns a
string as required.
 
You need to use the Format function vice the formatting the control.

="Thank you for your " &
IIf([DonationType]="Cash",
Format([DonationValue],"Currency"),[DonationType]) &
" donation on "
Format([DonationDate],"mmmm d, yyyy") & "." &
" " & [FirstName] & ", " & "it is
your continued support, along with additonal donors like
you that makes New Options the success it is."
 
John,

Thank you for the help. It gave me exactley what I was
looking for. Can you recommend a reference source which
will give me the syntax you provided. I am currently
using "Access 97 Unleashed" from SAMS.
Again thank you very much.
Dave v.
-----Original Message-----
You need to use the Format function vice the formatting the control.

="Thank you for your " &
IIf([DonationType]="Cash",
Format([DonationValue],"Currency"),[DonationType]) &
" donation on "
Format([DonationDate],"mmmm d, yyyy") & "." &
" " & [FirstName] & ", " & "it is
your continued support, along with additonal donors like
you that makes New Options the success it is."

Dave v. said:
I am new to ACCESS and mostly self taught.
The following was extracted from an Access Report "Thank
you Letter" I am trying to create. It almost works the
way I want I to. A sample of the output follows the code
segment. The whole string is in a single text box.
I want to format [DonationValue] as $10,000, and I want
to format [DonationDate]as October 26, 2003, but I cannot
find a way to include the "Format" parameter in the
string. Can someone help with an example or tell me what
I need to modify to make the changes. Since my ACCESS
Unleashed book doesn't help; does any one have a
recommendatin for another reference source.

="Thank you for your " & IIf([DonationType]="Cash",
[DonationValue],[DonationType]) & " donation on" & " " &
[DonationDate] & "." & " " & [FirstName] & ", " & "it is
your continued support, along with additonal donors like
you that makes New Options the success it is."

Thank you for your 5000 donation on 10/24/2003. Jane, it
is your continued support, along with additonal donors
like you that makes New Options the success it is.

Thanks for the help!
D.K. van Wagenen
.
 
Back
Top