If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
tables format percentages
I'm trying to setup one field in my table to show percentages. I've selected
format=percentage and tried everything from deciaml to double to long integer etc. When I enter the digits "75" the field will display 7500.00%. How can I setup the field to show 75%? I gotta be missing something simple here... thanks |
#2
|
|||
|
|||
Enter .75 if you want 75%.
-- Duane Hookom MS Access MVP "shank" wrote in message ... I'm trying to setup one field in my table to show percentages. I've selected format=percentage and tried everything from deciaml to double to long integer etc. When I enter the digits "75" the field will display 7500.00%. How can I setup the field to show 75%? I gotta be missing something simple here... thanks |
#3
|
|||
|
|||
I understand that, but I guess my thoughts were along entering a value like
"seventy-five percent" as opposed to "seventy-five hundredths of a percent" to get my desired end results. thanks "Duane Hookom" wrote in message ... Enter .75 if you want 75%. -- Duane Hookom MS Access MVP "shank" wrote in message ... I'm trying to setup one field in my table to show percentages. I've selected format=percentage and tried everything from deciaml to double to long integer etc. When I enter the digits "75" the field will display 7500.00%. How can I setup the field to show 75%? I gotta be missing something simple here... thanks |
#4
|
|||
|
|||
If you want to allow users to enter 75 to represent .75 (75%) then you can
add some code to the After Update event of the text box like: Private Sub txtPctComplete_AfterUpdate() If Me.txtPctComplete 2 Then Me.txtPctComplete = Me.txtPctComplete / 100 End If End Sub If the value entered is greater than 2, the value will be divided by 100. You might want to check for nulls or change the 2 to 1. -- Duane Hookom MS Access MVP -- "shank" wrote in message ... I understand that, but I guess my thoughts were along entering a value like "seventy-five percent" as opposed to "seventy-five hundredths of a percent" to get my desired end results. thanks "Duane Hookom" wrote in message ... Enter .75 if you want 75%. -- Duane Hookom MS Access MVP "shank" wrote in message ... I'm trying to setup one field in my table to show percentages. I've selected format=percentage and tried everything from deciaml to double to long integer etc. When I enter the digits "75" the field will display 7500.00%. How can I setup the field to show 75%? I gotta be missing something simple here... thanks |
#5
|
|||
|
|||
"shank" wrote in
: When I enter the digits "75" the field will display 7500.00%. How can I setup the field to show 75%? I gotta be missing something simple here... An alternative approach is to rethink the design a little bit. A value of 75% _is_ the same as 0.75; and that is how it is stored and typed. What about storing the PercentagePoints as a number, and then accounting for that in any maths that comes afterwards: SELECT FullPrice * (100 - PercentDiscount)/100 AS NetPrice FROM etc which is only trivially harder than SELECT FullPrice * (1 - DiscountFraction) AS NetPrice which is presumably what you are doing at the moment. If you want it to look nice, put a label control to the Right of the text box control and put a single '%' character in it, just to remind users that they have to put in a percentage amount. Hope that helps Tim F |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tables used during development | rpw | New Users | 6 | July 1st, 2004 01:29 AM |
Mutliple Tables lookup? | Westley | Database Design | 4 | June 15th, 2004 01:07 AM |
Format All Tables | Kevin Barmish | Tables | 3 | June 11th, 2004 02:58 PM |
Multiple Many-To-Many Tables | Tom | Database Design | 7 | May 15th, 2004 03:47 AM |