Comparing 2 same value but system say it isnot equal

  • Thread starter Benjamins via AccessMonster.com
  • Start date
B

Benjamins via AccessMonster.com

Hi,

I have a system where there is a subform. The subform have 2 field [FieldA
and FieldB]. Since it is in datasheet view, User will list of records but
they can only enter in either FieldA or FieldB.

The system will total the values for both fields and put the value into the
textboxes txtSumA and txtSumB. The system will make sure both value are equal
before allow the user to continue.

For on of the entries, the system prompt the user that the value of the
textboxes are not equal even though it show the same.

All my value had been round up to 2 decimial place before the summing.

Can anyone help me with this issue.
 
J

Jeanette Cunningham

Hi Benjamins,
you can use the format function to tell access what to compare.
Use code to format txtSumA and txtSumB to the same format for the
comparison.

If Format(Me.txtSumA, "#.00") = Format(Me.txtSumB, "#.00") Then
'they're equal
End If

You may need to play with ("#.00") to make it fit your data, but that gives
the idea.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top