Results 1 to 3 of 3
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Updating a RecordSet Clone

    I've added some, what I believed to be simple, code to an existing Sub that is looping through a RecordsetClone. I've commented out statements that I don't want to execute while I test the few added statements you see following the Debug.Print.

    The Debug.Print confirmed that the field ".CYP" is in fact Null where it is Null, but the "If .CYP = Null Then" statement resulted in "False" every time the statement was encountered and the desired statements that follow a "True" condition did not run. I put a Breakpoint on the statement "If .PCCode <> "C" Then" but it never fired.

    Any ideas?

    Code:
        With Me.RecordsetClone
            .MoveFirst
        
            Do While .EOF = False
            '.Edit
            '.LYP = .CYP
            '.Update
           '
           ' .Edit
           ' .CYP = .NYP
           ' .Update
           '
           ' .Edit
           ' .NYP = Empty
           ' .Update
            
            'See if individual has already paid for the new year.
    'Debug.Print .CYP
            If .CYP = Null Then
                If .PCCode <> "C" Then    "Don't negate any notification of pending data changes.
                    .Edit
                    .PCCode = Empty
                    .Update
                End If
            End If
            
            .MoveNext
            Loop
            
        End With


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Cannot compare anything to Null. See Error 5 in http://allenbrowne.com/casu-12.html

    Use IsNull() function in VBA conditionals.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    How embarrassing........... I knew that SIGH!
    Thanks,
    Bill

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

Similar Threads

  1. Replies: 9
    Last Post: 06-01-2017, 08:29 AM
  2. recordset clone and search
    By Sweetu in forum Forms
    Replies: 5
    Last Post: 12-09-2016, 04:33 AM
  3. recordset clone method
    By vientito in forum Programming
    Replies: 1
    Last Post: 10-30-2014, 11:33 PM
  4. RecordSet Clone Problem with code
    By rlsublime in forum Programming
    Replies: 8
    Last Post: 06-21-2012, 11:56 AM
  5. multiple combo boxes recordset clone
    By trigirl67 in forum Forms
    Replies: 1
    Last Post: 01-30-2012, 02:32 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