Results 1 to 3 of 3
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Integer not incrementing


    For some reason my integer, i, is not incrementing by 0.5. I have it defined as an integer. Any ideas? Thanks in advance.

    Code:
    rs.FindFirst "[EmplID] = " & fldID
    i = -1
    For Each fld In rs.Fields
            i = i + 0.5
            If i > 0 Then
                If i = Int(i) Then
                    vWeekVal = rs("Week" & i)
                    If DatePart("ww", vWeekVal) = DatePart("ww", emplDate) Then
                        If DatePart("yyyy", vWeekVal) = DatePart("yyyy", emplDate) Then
                            rs.Edit
                            rs("Exempt" & i).Value = -1
                            rs.Update
                        End If
                    End If
                End If
            End If
        Next fld

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Answered my own question....Don't know what I was thinking trying to make an Integer take a decimal...

  3. #3
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    http://www.techterms.com/definition/integer

    An integer cannot have a decimal value. Try declaring it as a double or float.


    EDIT: woah, we posted at the same time. Hivemind.

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

Similar Threads

  1. Incrementing a value in a form
    By erbuchan in forum Access
    Replies: 10
    Last Post: 01-26-2011, 12:33 AM
  2. Incrementing a field
    By Wayne311 in forum Programming
    Replies: 20
    Last Post: 01-20-2011, 06:21 PM
  3. Figure Numbers incrementing over Page Breaks
    By jezzamax in forum Reports
    Replies: 3
    Last Post: 12-19-2010, 08:05 PM
  4. Adding column as INTEGER makes it a long integer?
    By luckycharms in forum Programming
    Replies: 2
    Last Post: 10-20-2010, 02:47 PM
  5. Custom & Auto Incrementing Job Number
    By mastromb in forum Programming
    Replies: 1
    Last Post: 01-05-2010, 02:58 PM

Tags for this Thread

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