Decimal problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Morning,
I am having problem with the field Previous Balance once I
have press SAVE and the Temp Balance is transfer to the
new record under Previous Balance, the number is rounding
up. Because this form is a budget form, I cannot have it
round up. Would it be "Dim INIFileNum As Integer" the
problem?

Can someone help me with this?

Here's the code that I am using. What is wrong with it?

TPrivate Sub Save_Click()
On Error GoTo Err_Save_Click

Dim INIFileNum As Integer


[temp balance] = [Previous Balance] - [Grand Balance]
INIFileNum = [temp balance]
DoCmd.GoToRecord , , acNext
[Previous Balance] = [INIFileNum]


' DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

Exit_Save_Click:
Exit Sub

Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click

End Sub

Thank you

Michelle
 
Good Morning,
I am having problem with the field Previous Balance once I
have press SAVE and the Temp Balance is transfer to the
new record under Previous Balance, the number is rounding
up. Because this form is a budget form, I cannot have it
round up. Would it be "Dim INIFileNum As Integer" the
problem?

Can someone help me with this?

Here's the code that I am using. What is wrong with it?

TPrivate Sub Save_Click()
On Error GoTo Err_Save_Click

Dim INIFileNum As Integer

[temp balance] = [Previous Balance] - [Grand Balance]
INIFileNum = [temp balance]
DoCmd.GoToRecord , , acNext
[Previous Balance] = [INIFileNum]

' DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

Exit_Save_Click:
Exit Sub

Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click

End Sub

Thank you

Michelle

Yes, if the value contains decimals.
An integer, by definition, is a whole number.
Change your variable to currency.

Dim INIFileNum As Currency
 
Michelle,
Would it be "Dim INIFileNum As Integer" the
problem?

Very likely. Integer and Long Integer data types cannot store decimal
values and so will round. Try using Double or Single as the data type.

hth,
--

Cheryl Fischer, MVP Microsoft Access



Good Morning,
I am having problem with the field Previous Balance once I
have press SAVE and the Temp Balance is transfer to the
new record under Previous Balance, the number is rounding
up. Because this form is a budget form, I cannot have it
round up. Would it be "Dim INIFileNum As Integer" the
problem?

Can someone help me with this?

Here's the code that I am using. What is wrong with it?

TPrivate Sub Save_Click()
On Error GoTo Err_Save_Click

Dim INIFileNum As Integer


[temp balance] = [Previous Balance] - [Grand Balance]
INIFileNum = [temp balance]
DoCmd.GoToRecord , , acNext
[Previous Balance] = [INIFileNum]


' DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

Exit_Save_Click:
Exit Sub

Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click

End Sub

Thank you

Michelle
 
Back
Top