J
JohnB
Hi. I posted this two days ago with no response. Thought Id give it one more
try. Thanks.
Hi. Ive already had help with this code, from Rick Brandt and I now see that
another mod is needed. This code is part of the On Click code for a Schools
forms command button and opens a form called frmMentorsAndSBTs and in it,
shows records where the MentorID is linked to the SchoolID via
tblMentorSBTSchool. Ive now realised that, although frmMentorsAndSBTs is set
to show records alphabetically ascending by Mentor surname, this code
overwrites this and jumbles up the records. Is there a way of changing this
code so that it selects the required records then sorts them prior to
opening the form? The field to sort on is MentorSecondName and is in table
Mentors, where the MentorID is the same as that selected by the code. Can
anyone help please? Thanks, JohnB
DoCmd.OpenForm "frmMentorsAndSBTs", , , "MentorID IN (SELECT MentorID FROM
tblMentorSBTSchool WHERE (tblMentorSBTSchool.SchoolID=" & SchoolID & " And
[MovedToSchoolID] Is Null))"
try. Thanks.
Hi. Ive already had help with this code, from Rick Brandt and I now see that
another mod is needed. This code is part of the On Click code for a Schools
forms command button and opens a form called frmMentorsAndSBTs and in it,
shows records where the MentorID is linked to the SchoolID via
tblMentorSBTSchool. Ive now realised that, although frmMentorsAndSBTs is set
to show records alphabetically ascending by Mentor surname, this code
overwrites this and jumbles up the records. Is there a way of changing this
code so that it selects the required records then sorts them prior to
opening the form? The field to sort on is MentorSecondName and is in table
Mentors, where the MentorID is the same as that selected by the code. Can
anyone help please? Thanks, JohnB
DoCmd.OpenForm "frmMentorsAndSBTs", , , "MentorID IN (SELECT MentorID FROM
tblMentorSBTSchool WHERE (tblMentorSBTSchool.SchoolID=" & SchoolID & " And
[MovedToSchoolID] Is Null))"