Results 1 to 5 of 5
  1. #1
    Kipster1203 is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    54

    Invalid Use of Null!?!


    I've been stumped on this for a while this is where it breaks, it runs through this loop but when I step out of it, that's when it gives the Invalid Use of Null error, any ideas anyone??????

    Code:
    Do While Not rs1.EOF
        delivery_desc = rs1.Fields(2)
                        
        If Not IsNull(rs1.Fields(1)) Then
              date_difference = rs1.Fields(0) - rs1.Fields(1)
        Else
              date_difference = rs1.Fields(0) - Date
        End If
    
        rs2.AddNew
                    
        If date_difference > 0 Then
              rs2.Fields(0) = date_difference
                    
        ElseIf date_difference < 0 Then
              rs2.Fields(1) = date_difference
                    
        Else
              rs2.Fields(0) = 0.1
                    
        End If
                    
              rs2.Fields(2) = delivery_desc
              rs2.Update
              rs1.MoveNext
    Loop

  2. #2
    Kipster1203 is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    54
    I figured it out, you all can rest easy tonight...

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Care to share your solution with the rest of the readers of this forum while you follow the link in my sig to mark this thread as Solved?

  4. #4
    Kipster1203 is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    54
    Quote Originally Posted by RuralGuy View Post
    Care to share your solution with the rest of the readers of this forum while you follow the link in my sig to mark this thread as Solved?
    Code:
    Do While Not rs1.EOF
        rs2.AddNew
    
        rs1.Fields(2) = rs2.Fields(2)
                        
        If Not IsNull(rs1.Fields(1)) Then
              date_difference = rs1.Fields(0) - rs1.Fields(1)
        Else
              date_difference = rs1.Fields(0) - Date
        End If
                    
        If date_difference > 0 Then
              rs2.Fields(0) = date_difference
                    
        ElseIf date_difference < 0 Then
              rs2.Fields(1) = date_difference
                    
        Else
              rs2.Fields(0) = 0.1
                    
        End If
                  
              rs2.Update
              rs1.MoveNext
    Loop
    Sometimes Access only wants things done one way...

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great! Go ahead and follow the link in my sig for directions on how to mark this thread as Solved.

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

Similar Threads

  1. VBA Import Error on Invalid Characters
    By jhrBanker in forum Import/Export Data
    Replies: 2
    Last Post: 11-25-2009, 12:07 PM
  2. GetRows - Invalid Use of Nulls
    By Wannabe_Pro in forum Programming
    Replies: 3
    Last Post: 07-22-2009, 07:07 AM
  3. List box value to variable - invalid use of null?
    By Orabidoo in forum Programming
    Replies: 2
    Last Post: 05-07-2009, 11:06 AM
  4. Replies: 0
    Last Post: 11-17-2006, 09:38 AM
  5. Invalid Operation
    By ScottG in forum Forms
    Replies: 0
    Last Post: 11-14-2006, 02:05 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