|
-
Mar 18th, 2012, 11:37 PM
#1
Thread Starter
Junior Member
[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
-
Mar 19th, 2012, 12:43 AM
#2
Re: Runtime "94" invalid use of null:
check if any null (blank) in the database.
-
Mar 19th, 2012, 04:36 PM
#3
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|