Unanswered: Clearing an Unbound Field of details when I press ESC
I have a form called ClientCaseNotesForm which opens up to a new record.
It has a field called [ClentID]
Also on this form is an unbound field called [ProgramLU] which has a select statement as follows:
SELECT ClientProgramReferral.ProgramID, ClientProgramReferral.ClientID, ProgramDetails.ProgramName, ProgramDetails.DeptName, ClientProgramReferral.DateReferred, ClientProgramReferral.DateReferralEnded, ClientProgramReferral.ClientID, ClientProgramReferral.ProgramID, ClientProgramReferral.DateReferred
FROM ClientProgramReferral INNER JOIN ProgramDetails ON ClientProgramReferral.ProgramID = ProgramDetails.ProgramID
WHERE (((ClientProgramReferral.ClientID) Like [Forms]![ClientCaseNotesForm]![ClientID]))
ORDER BY ClientProgramReferral.ClientID, ClientProgramReferral.ProgramID, ClientProgramReferral.DateReferred;
When I open this form the [ProgramLU] is blank. When I select a [ClientID] the unbound [ProgramLU] does not display the details relating to the Client (as per the select statement). So I added in the following code which has fixed this problem (now when I select a [ClientID] the [ProgramLU] shows the details).
Private Sub ClientID_Exit(Cancel As Integer)
My problems is that when I click on the escape button to undo any fields I have entered on the form, the [ProgramLU] still retains the details of the last client selected. I would like to see this return back to showing nothing.
I have spent a lot of time trying to achieve this without success. Can anyone please provide some advice?