[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
Re: Runtime "94" invalid use of null:
check if any null (blank) in the database.
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
:wave: