Just guessing, are you in List View? If the field is in the header for List View, it will only show from the first record. If you're in form view, it changes as you change the record
Edit: Let me add, in List View, the first record shows. But if you scroll down and click into any field or even on the record page of a different record, the field will change.
Thank you for your answer Steve.
Yes, I am in List View, which does display the relevant records as I want. My objective is to produce (for subsequent printing) a list of surnames of people who were members in the inputted year and to display that chosen year at the top of the list .
Unfortunately, putting the "MembershpYear" field in the Header of the layout, whether in List or Form View does not achieve this, as you say it simply shows the first record in that field rather than displaying the value entered in lytSelectYear.
If you have further suggestions I would be most grateful.
SInce you have performed a find for records matching that value, a field showing data from the first record (actually the current record when you are in Browse mode), should show the correct data.
But you can also put the data you want to show in a global field or variable and then put that global field/variable in the header to show the data. Your script can assign that data to the global field or variable to make that happen.
Thanks for your suggestions Phil.
Because there is a One to Many relationship between Surname and MembershipYear , even after a Perform Find the first record is not always the same as the inputted year.
However I have had more success with your idea of a Global field and things are working as I wanted. Many thanks. I now want to trap a potential error where the global field does not match the "MembershipYear" from tblPeriod. Any ideas?
What you describe has me puzzled. If you are performing a find, the find criteria should omit the records with different values in the membership year field. Perhaps you are performing your find on the wrong table?
You are exactly right Phil - I was performing the find on the wrong table, which resulted in me finding a solution that was far too complex for a simple problem. Lesson learned - keep it simple!
I am very grateful, so many thanks again.