I have a form which has a subform.
This subform has as Sourc Object a table.
This table has a field of text type.
I 'm trying to loop through the form 's recordset:
Code:
Dim rs As Object
Set rs = Form_foods.RecordsetClone
On Error Resume Next
rs.MoveLast
On Error GoTo 0
RecordCount = rs.RecordCount
'Check to see if the recordset actually contains rows
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst 'Unnecessary in this case, but still a good habit
Do Until rs.EOF = True
a = rs!proteinsPer100grOrmlOrpc
Debug.Print rs!food & " a=" & a
rs.MoveNext
Loop
Else
MsgBox "There are no records in the recordset."
End If
(the field 's name is 'proteinsPer100grOrmlOrpc'.)
But it prints '67' instead of '6.7' (which is the actual text of the field) !!!
I repeat, it's a text field!!
Why on earth is this happening?