Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extra blank record in subform query 1

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
I have a form called frmPatientLookup that has a subform called

frmPatientLookupResult that is based on a query

Code:
SELECT tblPatientDemo.LastName, tblPatientDemo.FirstName, 

tblPatientDemo.DOB, tblPatientDemo.Gender, tblPatientDemo.PatientID
FROM tblPatientDemo
WHERE (tblPatientDemo.LastName Like forms!frmPatientLookup!txtLastName 

& "*" Or forms!frmPatientLookup!txtLastName Is Null) And 

(tblPatientDemo.FirstName Like forms!frmPatientLookup!txtFirstName & 

"*" Or forms!frmPatientLookup!txtFirstName Is Null) And 

(tblPatientDemo.DOB Like forms!frmPatientLookup!txtDOB & "*" Or 

forms!frmPatientLookup!txtDOB Is Null) And (tblPatientDemo.Gender Like 

forms!frmPatientLookup!cboGender & "*" Or 

forms!frmPatientLookup!cboGender Is Null);

when I click on the command button it gives me records based on
the critia I have inputed. But it also creates a blank record.

Why am I getting that blank record? and how can I correct it?


Newbie in search of knowledge
 
Have you tried to set the AllowAdditions property of frmPatientLookupResult to False ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks that work but why was access creating that blank record in the subform

Newbie in search of knowledge
 
cos you're in a 'mode' where you can create records and access creates a record ready for you so can always see a 'blank record'. Check it out in a table.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top