Solved

Format a bunch of values to currency in a msflexgrid

Posted on 2014-01-19
4
257 Views
Last Modified: 2014-01-19
This works, but their may be an easier way to write it
i am loading from a saved udt and a lot of the values need formatting as currency, but not all
gridCardStats.TextMatrix(5, 1) = .tmpLost
    gridCardStats.TextMatrix(5, 1) = Format(gridCardStats.TextMatrix(5, 1), "Currency")
is there a better way to write this ?
0
Comment
Question by:isnoend2001
  • 2
  • 2
4 Comments
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39792323
Instead of

gridCardStats.TextMatrix(5, 1) = .tmpLost
    gridCardStats.TextMatrix(5, 1) = Format(gridCardStats.TextMatrix(5, 1), "Currency")

just do

gridCardStats.TextMatrix(5, 1) = Format(.tmpLost, "Currency")
0
 

Author Closing Comment

by:isnoend2001
ID: 39793325
thanks. thought there was a better way, been doing it the hard for a long time
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 39793348
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2013
0
 

Author Comment

by:isnoend2001
ID: 39793377
Thanks i am posting another question where i want to show just the part of a file name  after the last "\"
Hopefully you can answer
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now