Results 1 to 3 of 3
  1. #1
    orcinus is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    67

    Is Not Null With Variant Variable Assigned To Date Field

    The below function works as is. However, I would like to change the bolded part, if possible, to give a result of "PEND" when any date entry is in the orig_qe_st_dt field.

    When I put in the following to that part of the code, I get an "object required" error:

    Case 1 And orig_qe_st_dt and orig_qe_st_dt is not null
    fcn_mbr_status = "PEND"

    As you can see below, making the orig_qe_st_dt a variant when the actual field is a date field works when using the "IsNull()" argument. But it will not work for the "Is Not Null" argument..

    Any help to resolve this is appreciated!

    Thanks..


    Public Function fcn_mbr_status(qe_code As Integer, orig_qe_st_dt As Variant)
    Select Case qe_code
    Case 1 And IsNull(orig_qe_st_dt)
    fcn_mbr_status = "PEND"
    Case 1 And orig_qe_st_dt > #1/1/1900#
    fcn_mbr_status = "PEND"
    Case 2 And IsNull(orig_qe_st_dt) 'DEATH
    fcn_mbr_status = "PEND"
    Case 3 And IsNull(orig_qe_st_dt) 'DISABILITY
    fcn_mbr_status = "PEND"
    Case 4 And IsNull(orig_qe_st_dt) 'DIVORCE/LEGAL SEPARATION
    fcn_mbr_status = "PEND"
    Case 5 And IsNull(orig_qe_st_dt) 'LOSS OF DEP STATUS
    fcn_mbr_status = "PEND"
    Case 6 And IsNull(orig_qe_st_dt) 'SPOUSE ON MEDICARE
    fcn_mbr_status = "PEND"
    Case 7 And IsNull(orig_qe_st_dt) 'TERM
    fcn_mbr_status = "PEND"
    Case 8 And IsNull(orig_qe_st_dt) 'NOT ON COBRA


    fcn_mbr_status = "INVALID"
    End Select
    End Function

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    have you tried?

    Case 1 AND NOT IsNull(orig_qe_st_dt)
    fcn_mbr_status = "PEND"

  3. #3
    orcinus is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    67
    Perfect!

    Thanks..!

    Quote Originally Posted by NTC View Post
    have you tried?

    Case 1 AND NOT IsNull(orig_qe_st_dt)
    fcn_mbr_status = "PEND"

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

Similar Threads

  1. Set date field on subform to date variable
    By laavista in forum Access
    Replies: 4
    Last Post: 06-30-2010, 06:32 PM
  2. set date field on form to date variable
    By laavista in forum Access
    Replies: 3
    Last Post: 06-28-2010, 03:03 AM
  3. Control variable is Null
    By ngruson in forum Access
    Replies: 2
    Last Post: 04-21-2010, 10:27 AM
  4. detecting a null date
    By tedpottel in forum Queries
    Replies: 3
    Last Post: 03-02-2010, 01:45 PM
  5. List box value to variable - invalid use of null?
    By Orabidoo in forum Programming
    Replies: 2
    Last Post: 05-07-2009, 11:06 AM

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