Results 1 to 5 of 5
  1. #1
    panosss is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2017
    Posts
    2

    Access automatically strips dot from text field

    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?

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What is a and how is it defined?

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Code:
            Do Until rs.EOF = True                
                a = rs!proteinsPer100grOrmlOrpc
                Debug.Print "rs= " & rs!proteinsPer100grOrm10rpc
                Debug.Print rs!food & " a=" & a
                rs.MoveNext
            Loop
    Seeing the rs would prove a discrepancy....

  4. #4
    panosss is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2017
    Posts
    2
    I deleted and recreated the table from which Form_foods takes it's data and was fixed.
    I don't know what caused the problem.
    Thank you guys.

  5. #5
    Lena01 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Aug 2017
    Posts
    3
    • Strip Width Options:

      • Auto Widen Entire Strip option. When this option is selected, the program automatically adjusts the width of the selected design strips to be consistent with the span distances of the strips in the transverse direction. That is, if the selected design strip(s) is in the Layer A direction, you should have strips defined in the transverse Layer B direction, as the program will adjust the widths of the selected strips based on the support points for the Layer B strips. The width of a strip may be verified using the View menu > Select Display Options command or button and checking the Show Width option in the Design Strips area on the Set Display Options form.
      • User Specified Strip Segment Width option. When this option is selected, enter the width data in the areas described below.

        • Select the Strip Segment to be Edited: Select the segment to be edited from the Segment drop-down list. The strip widths specified in the User Specified Strip Segment Widths area apply to the selected segment. If more than one design strip has been selected, and the selected design strips do not all have the same number of segments, some of the segments in the list will not apply to all of the design strips. This list is available only if the User Specified Strip Segment Width option was selected in the Strip Width Options area.
        • User Specified Strip Segment Widths: Enter into the edit boxes the starting widths and ending widths for both the left and right sides for the segment selected in the Select the Strip Segment to be Editedarea. These edit boxes are available only if the User Specified Strip Segment Width option was selected in the Strip Width Options area. The orientation of left and right are as you look along the design strip segment from point n to point n+1.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-05-2015, 04:06 PM
  2. Replies: 2
    Last Post: 05-19-2014, 07:45 AM
  3. Replies: 1
    Last Post: 08-01-2010, 09:53 PM
  4. Replies: 1
    Last Post: 08-01-2010, 12:06 PM
  5. Replies: 11
    Last Post: 01-06-2010, 03:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums