Results 1 to 3 of 3

Thread: Validating for empty datafields

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    11

    Validating for empty datafields

    Hi I got a problem whereby my boss has failed to maintain the AS400 server's database. This means that I will have field "elrsnc" being empty and causing major problem to my work.

    Elrsnc is suppose to represent a value of 1-11. So base on the selected value i will insert a strFieldName (example value 1, strFieldname ="XRSN01") into another table empexit. My problem is if Im running my codes as of those below, how should I validate for rsCode.Fields("elrsnc") = ""


    sql2 = "select empno, edcode, elyyyy, elmm, eldd, elrsnc from EMPloyee " & _
    "where empno = '" & empno & "'"

    rsCode.Open sql2, cn, adOpenKeyset, adLockOptimistic

    intELRSNC = CInt(rsCode.Fields("elrsnc"))

    Select Case intELRSNC

    Case 1: strFieldName = "XRSN01"
    Case 2: strFieldName = "XRSN02"
    Case 3: strFieldName = "XRSN03"
    Case 4: strFieldName = "XRSN04"
    Case 5: strFieldName = "XRSN05"
    Case 6: strFieldName = "XRSN06"
    Case 7: strFieldName = "XRSN07"
    Case 8: strFieldName = "XRSN08"
    Case 9: strFieldName = "XRSN09"
    Case 10: strFieldName = "XRSN10"
    Case 11: strFieldName = "XRSN11"

    End Select

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I hope I'm not missing something, but what's the problem?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    11
    Hi! Sorry I didnt realise I actually posted this question twice. This is my other post http://www.vbforums.com/showthread.p...hreadid=286222

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width