×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Find error in currency feild
2

Find error in currency feild

Find error in currency feild

(OP)
Hello,

I have added up all payments in a table and get a sum that end in 3 decimals.

Obviously there must be a typo in there somewhere.

Initially I have formatted the currency field in the table to show 3 decimal places. My intention then was to use the Right function to select the 3rd decimal digit and then find anything that wasn’t a zero.

The problem is that Access ignores the third decimal, so it returns a number on all results.

Is there any code that has been written or has anyone a solution to find typo errors in currency fields?

So in essence there must be one or more records that have a value at the 3rd decimal place - i.e. £50.238

It's a large table (200000+ records) so doing it manually would be a long job.

Many thanks Mark

RE: Find error in currency feild

Can't you just write a simple Select statement where you convert Payment field(?) to text/string, find the position of a period and count the number of characters after the period ponder

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Find error in currency feild

(OP)
Thank you for your help (again!).

So I have converted text - field is called DEBIT

How do I find the position of a period and count the number of characters after the period. I really want to identify any string that has 3 or more characters after the period.

Thank you Mark

RE: Find error in currency feild

Hint:

CODE

Option Explicit

Sub test()
Dim strNumber As String

strNumber = "50.238"

Debug.Print "Period at position:                " & InStr(strNumber, ".")
Debug.Print "Digits after the period:           " & Mid(strNumber, InStr(strNumber, ".") + 1)
Debug.Print "Number of digits after the period: " & Len(Mid(strNumber, InStr(strNumber, ".") + 1))

End Sub 

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Find error in currency feild

You can filter the table, in advanced filter:
- field: [TestedField]<>Round([TestedField],2)
- criteria: TRUE

It's for manual correction, if the number of wrong entries is limited. However, it gives an opportunity to verify, what is wrong.

combo

RE: Find error in currency feild

(OP)
Thank you both. Superstars 👍

RE: Find error in currency feild

So, what did you do? What did you find with your DEBIT field? What was the problem?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Find error in currency feild

(OP)
There was a typo - somethimg like £4.856

I manually found it in the end - took 2 hrs - thank you for all your help - Mark

RE: Find error in currency feild

Your field containing the money is declared as text ponder

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close