PARAMETERS
EnterLandlordRef string,
EnterFirstName string,
EnterSurname string;
SELECT [Landlord Details].[Landlord Ref], [Property Details].[Property Ref], [Property Details].[Property Address], [Property Details].County, [Property Details].[Post Code], [Property Details].[Property Type], [Property Details].Bedrooms, [Property Details].Floor, [Property Details].[Start Date], [Property Details].[End Date], [Property Details].Rent, [Property Details].[Guaranteed Rent], [Property Details].Supplier, [Landlord Details].Firstname, [Landlord Details].Surname, [Landlord Details].[Contact Address], [Landlord Details].[Home No], [Landlord Details].[Work No], [Landlord Details].[Mobile No], [Landlord Details].[Email Address]
FROM [Landlord Details] INNER JOIN [Property Details] ON [Landlord Details].[Landlord Ref] = [Property Details].[Landlord Ref]
WHERE
(
(([Landlord Details].[Landlord Ref])=[EnterLandlordRef]) OR
IsNull ([Landlord Details].[Landlord Ref]) OR
[Landlord Details].[Landlord Ref]=''
)
AND
(
(([Landlord Details].Firstname)=[EnterFirstname]) OR
IsNull ([Landlord Details].Firstname) OR
[Landlord Details].Firstname =''
)
AND
(
(([Landlord Details].Surname)=[Enter Surname) OR
IsNull ([Landlord Details].Surname) OR
[Landlord Details].Surname= ''
);