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