Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

to dim or not to dim

Status
Not open for further replies.

thegameoflife

Programmer
Dec 5, 2001
206
US
All of this is done in VBA. I’m having an issue with importing text files. After the import I’m running a running a query to match the new table to another table, checking to see if the data is not duplicated. So in code I keep coming across an issue of field data not matching. Say I set x = “Sales_New” and y = “Sales_Old”. The first issue is x = 102.0000252 and y = 102.00, so to solve this one I tried Dim x and y as currency. Then issue two arose, if there are no new sales I get an error on x. Null in the currency field does not work……

If you can make sense of this and you can help PLEASE do………..
 
If the odd numbers at the end are not an issue, try using the round function to see if that helps ->
intX = round(intX, 2)

Good Luck
 
You could try:

if not isnull(FieldName) then
FieldName = int(FieldName*100) / 100
endif

this only acts on a non-null fields.

John
 
?????????????????????
Code:
        If Not IsNull("IND Trans") Then
            FieldName = Int("IND Trans" * 100) / 100
        End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top