Inline Coding "Format" function

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
 
D

Duane Hookom

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.
 
J

John Spencer (MVP)

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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top