Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

converting numbers to currency

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul M - 09 Jan 2006 17:56 GMT
I have a database that has a couple of hundred fields, most are text but I do
have some that I want to set for currency.

Problem:  the currency input mask that access has is not what I need.  I
would like to just input numbers, then when I press tab, have those numbers
convert to currency.

Example:  if I type 123456, after tab I would like it to look like this
$1,234.56
              or 3456, after tab I would like it to look like this $34.56

a solution to this problem would help me alot.

Thanks in advance
Paul M
Steve Schapel - 09 Jan 2006 18:57 GMT
Paul,

Having the $ sign and all that is simple, it is just the Format property
of the control set to Currency.

On the After Update event of the control, put code like this...

 If IsNull(Me.NameOfControl.OldValue) Then
     Me.NameOfControl = Me.NameOfControl / 100
 End If

Signature

Steve Schapel, Microsoft Access MVP

> I have a database that has a couple of hundred fields, most are text but I do
> have some that I want to set for currency.
[quoted text clipped - 11 lines]
> Thanks in advance
> Paul M
John Spencer - 09 Jan 2006 19:51 GMT
Use the following code in the after update event of a control.

If Int(Me.SomeControl) = Me.SomeControl then
   Me.SomeControl = Me.SomeControl/100
End If

>I have a database that has a couple of hundred fields, most are text but I
>do
[quoted text clipped - 13 lines]
> Thanks in advance
> Paul M
John Nurick - 09 Jan 2006 20:06 GMT
I can't do better than the answer Wayne gave to your similar recent
question here under the subject "Currency Input Mask".

>I have a database that has a couple of hundred fields, most are text but I do
>have some that I want to set for currency.
[quoted text clipped - 11 lines]
>Thanks in advance
>Paul M

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.