Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 2010 - report text box formatting

Posted on 2013-11-27
6
Medium Priority
?
973 Views
Last Modified: 2013-12-04
I have a report that shows tax amounts in various currencies.

I want the tax amount to be formatted with square bracketing and the variable currency symbol shown like:
[$100.00]
[€250.00]
[£500.00]

At the report detail format event  I use vba:

Me!sInvoiceTax = "[" & GroupCurrencySymbol & Format(InvoiceTax, #,##.0.00) & "]"

At the group footer format event I tried to use vba:

Me!txtTotalInvoiceTax = "[" & GroupCurrencySymbol & Format(sum([InvoiceTax]), "#,###,##0.00") & "]"

but function sum is not recognised.

Instead I would prefer to have a bound text box in the group footer with control source:
sum([InvoiceTax]
and use the property sheet text box format property:
"[ $"#,##0.00"]"  but to change the $ to be my variable GroupCurrencySymbol

but I don't know how to set up the text box format property to do this.  How can I achieve the formatting I need, either via the property sheet or vba.
0
Comment
Question by:MonkeyPie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 25

Expert Comment

by:chaau
ID: 39682800
Have you tried to use this expression as your format string:
"[ " & [GroupCurrencySymbol] & "#,##0.00" & "]"

Open in new window

0
 

Author Comment

by:MonkeyPie
ID: 39682816
I added the following to the group footer format event:
 
  Me.txtSumNetInvoice.Format = "[ " & [GroupCurrencySymbol] & "#,##0.00" & "]"

Open in new window

It didn't work.  I just got 100.00 with no formatting at all.
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 39683234
This should work:

Me!txtTotalInvoiceTax = Format(Sum([InvoiceTax]), "\[\" & [GroupCurrencySymbol] & "#,##0.00\]")

/gustav
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:MonkeyPie
ID: 39684162
Sum is an SQL function, not VBA, so I can't use the code above.


In my initial post I wrote...
At the group footer format event I tried to use vba:

Me!txtTotalInvoiceTax = "[" & GroupCurrencySymbol & Format(sum([InvoiceTax]), "#,###,##0.00") & "]"

but function sum is not recognised.
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 39684863
That's right. Try this instead with an additional textbox:

Me!txtSumInvoiceTax with this controlsource:
=Sum([InvoiceTax])

Me!txtTotalInvoiceTax = "[" & GroupCurrencySymbol & Format([txtSumInvoiceTax]), "#,###,##0.00") & "]"

/gustav
0
 
LVL 20

Accepted Solution

by:
clarkscott earned 2000 total points
ID: 39685000
Sounds like the "sum" isn't working.
How about creating an invisible text box and add the sum function to it's control source.  Then, instead of sum(InvoiceTax) in your formula (above) you simply use the new text box you created.

Perhaps, trying this will discover why your sum doesn't work.

Scott Clark
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question