I have a report linked to a query which details employee's address and outstanding stock options. When I try to preview the report it asks me to enter a parameter value for 'Surname'. There was one instance where the Forename and Surname are obtained from the query which is working fine.
I have checked the query and the design of the report, and there is no where have I created another text box for printing Surname.
I have tried giving some long junk name to check if it is being printed anywhere on the report, but it doesn't seem to be appearing on the report.
Could there be any other reason?
Any help would be greatly appreciated.
SELECT tblOptions.TRANSACTIONID, tblOptions.GRANT_DATE, tblOptions.OPTION_PRICE, tblOptions.NO_OPTIONS AS Granted, IIf([NO_LAPSED] Is Null,0,[NO_LAPSED]) AS Lapsedtodate, IIf([Exercised_todate] Is Null,0,[Exercised_todate]) AS Exercisedtodate, [Granted]-[Lapsedtodate]-[Exercisedtodate] AS Optionos, tblOptions.NO_LAPSED, tblOptions.DATE_LAPSED, tblOptions.DATE_LAPSED_UPDATE, tblOptions.[NO_CPTE registrar], tblParticipants.[Emp No], tblParticipants.NOM, tblParticipants.PRENOM, IIf(tblParticipants!Leaverid Is Null,DateAdd("yyyy",10,[GRANT_DATE]),IIf(tblParticipants!Leaverid=5 Or tblParticipants!Leaverid=7,[Leavedate],DateAdd("d",1,DateAdd("m",3,[leavedate])))) AS Expires, IIf([employee number] Is Null,[Adr1],[address line1]) AS Address11, IIf([employee number] Is Null,[Adr2],[address line2]) AS Address22, IIf([employee number] Is Null,[Adr3],[address line3]) AS Address33, IIf([employee number] Is Null,[Adr4],[address line4]) AS Address44, IIf([employee number] Is Null,[Postcode],[post code]) AS Postcodee, IIf(tblParticipants!leaverid Is Not Null,DateAdd("m",3,[leavedate]),DateAdd("yyyy",10,[Grant_date])) AS Last_date_to_exercise, IIf([96scr]!Leavedate Is Null,tblParticipants!Leavedate,[96scr]!Leavedate) AS leavedate, DateAdd("yyyy",3,[Grant_date]) AS Vesting_date, tblOptions.Plan_ref, Leaverreasons.leavereason, tblParticipants!Leaverid AS leaver_status
FROM ((((tblParticipants LEFT JOIN (Leaverreasons RIGHT JOIN 96scr ON Leaverreasons.leavereason = [96scr].leavereason) ON tblParticipants.[Emp No] = [96scr].empno) LEFT JOIN Addresses ON tblParticipants.[Emp No] = Addresses.[employee number]) LEFT JOIN tblOptions ON tblParticipants.NO_CPTE = tblOptions.[NO_CPTE registrar]) LEFT JOIN Q_sum_exercises ON tblOptions.TRANSACTIONID = Q_sum_exercises.TRANSACTIONID) LEFT JOIN [Leaver codes] ON tblParticipants.LeaverId = [Leaver codes].leaverid
WHERE (((tblOptions.[NO_CPTE registrar])=[Forms]![frm_Participants]![NO_CPTE]));
check to control source of your field for surname in your report. I'll bet there is a typo in there.
It's asking you where it should get the info for the fieldname surname. So if you don;t get that when you open the query, it's in the report.