I wrote the following code which basically rounds my tables i selec tto the nearest interger. It works for the most part except that it changes some of the data to blanks...i have tried it a few times always does it. The data is numeric so i dont understand why it selects what seems to be random data and deletes the cell.... anyone know?
Private Sub RunRemoveDecimal_Click()
On Error GoTo Err_RunRemoveDecimal
Dim strSQL As String
Dim strSelect As String
For i = 0 To lstField.ListCount - 1
strSelect = strSelect & "[" & Me!cboTable & "].[" & lstField.Column(0, i) & "] = (CInt([" & lstField.Column(0, i) & "]*1))/1,"
Next i
strSQL = "Update [" & Me!cboTable & "] Set " & Left(strSelect, Len(strSelect) - 1)
MsgBox strSQL
DoCmd.RunSQL (strSQL)
Exit_RunRemoveDecimal_Click:
Exit Sub
Err_RunRemoveDecimal:
MsgBox Err.Description
Resume Exit_RunRemoveDecimal_Click
End Sub
Private Sub RunRemoveDecimal_Click()
On Error GoTo Err_RunRemoveDecimal
Dim strSQL As String
Dim strSelect As String
For i = 0 To lstField.ListCount - 1
strSelect = strSelect & "[" & Me!cboTable & "].[" & lstField.Column(0, i) & "] = (CInt([" & lstField.Column(0, i) & "]*1))/1,"
Next i
strSQL = "Update [" & Me!cboTable & "] Set " & Left(strSelect, Len(strSelect) - 1)
MsgBox strSQL
DoCmd.RunSQL (strSQL)
Exit_RunRemoveDecimal_Click:
Exit Sub
Err_RunRemoveDecimal:
MsgBox Err.Description
Resume Exit_RunRemoveDecimal_Click
End Sub