dcsimg
Results 1 to 3 of 3

Thread: [RESOLVED] Runtime "94" invalid use of null:

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2011
    Posts
    17

    Resolved [RESOLVED] Runtime "94" invalid use of null:

    when I run my program it goes runtime 94 invalid use of null?
    what is this null? does it mean nothings inside?
    Code:
    Dim i As String
    Set db = OpenDatabase(App.Path & "\DentalRecordSystem.mdb")
    i = "select * from BS1D where LastName = " & "'" & txtSearch & "'"
    Set rec = db.OpenRecordset(i, dbOpenSnapshot)
    If rec.EOF = False Then
    txtPatientRef = rec!PatientRef
    txtLast = rec!LastName
    txtFirst = rec!GivenName
    txtMID = rec!MiddleName
    txtID = rec!ID
    txtOcc = rec!Occupation
    txtCitizenship = rec!Citizenship
    txtBday = rec!Birthday
    txtAge = rec!Age
    txtOffice = rec!OfficePhone
    txtHouse = rec!HousePhone
    txtMobile = rec!Mobile
    txtFax = rec!Fax

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Runtime "94" invalid use of null:

    check if any null (blank) in the database.
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Smile Re: [RESOLVED] Runtime "94" invalid use of null:

    Try isNull() Function to handle Null value .see the red line .
    Code:
    Dim i As String
    Set db = OpenDatabase(App.Path & "\DentalRecordSystem.mdb")
    i = "select * from BS1D where LastName = " & "'" & txtSearch & "'"
    Set rec = db.OpenRecordset(i, dbOpenSnapshot)
    If rec.EOF = False Then
    txtPatientRef = IIF(iSNull(rec!PatientRef),"",rec!PatientRef)
    txtLast = iif(ISnULL(rec!LastName),"",rec!LastName)
    txtFirst = rec!GivenName
    txtMID = rec!MiddleName
    txtID = rec!ID
    txtOcc = rec!Occupation
    txtCitizenship = rec!Citizenship
    txtBday = rec!Birthday
    txtAge = rec!Age
    txtOffice = rec!OfficePhone
    txtHouse = rec!HousePhone
    txtMobile = rec!Mobile
    txtFax = rec!Fax

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width