Results 1 to 4 of 4

object required

  1. #1
    mainerain is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    38

    object required


    having difficulty with this, keep getting Object Required

    Code:
     dim SN as String
    
    If me.FldLoop1 is not null Then
    SN = me.FldLoop1
    Else: SN = me.FldLoop2
    
    End If

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,102
    Please show all of the related code.
    Sub or Function; appears to be part of some Form or Report Event???

    An overview showing the context for your question will help you get focused responses.
    Good luck.

  3. #3
    accesstos's Avatar
    accesstos is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    213
    FldLoop1 Ιs Νot Νull in SQL.
    In VBA: Not IsNull(Me.FldLoop1)

    So, the correct syntax is:
    Code:
    If Not IsNull(me.FldLoop1) Then
        SN = me.FldLoop1
    Else
        SN = me.FldLoop2
    End If
    Usually, I prefer:
    Code:
    If IsNull(me.FldLoop1) Then
        SN = me.FldLoop2
    Else
        SN = me.FldLoop1
    End If
    Saves one comparison.

  4. #4
    mainerain is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    38
    AWESOME! Thanks so much!

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

Similar Threads

  1. Object required error 424
    By GraeagleBill in forum Programming
    Replies: 5
    Last Post: 06-22-2018, 12:00 PM
  2. Error Object required: Please help
    By lccrews in forum Programming
    Replies: 1
    Last Post: 06-14-2018, 10:59 AM
  3. Object Required Error
    By sgp667 in forum Programming
    Replies: 1
    Last Post: 11-06-2012, 03:15 AM
  4. Object Required When Importing
    By barks1981 in forum Import/Export Data
    Replies: 4
    Last Post: 07-05-2011, 01:21 AM
  5. Object required
    By duckie10 in forum Access
    Replies: 1
    Last Post: 05-15-2009, 02:11 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
  •  
Tech Forums: Microsoft Office Forums