N
Noel
Hi. Can anyone help with this. I have rearranged part of
my Access 2002 mdb and now a command button that I set up
on a Schools form to open up a linked Mentors form needs
to be changed. I probably used a wizard to create the
button and code.
The Schools forms buttons relevant On Click code is
stDocName = "Mentors"
stLinkCriteria = "[SchoolID]=" & Me![SchoolID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
As you can see this calls up form Mentors, which is based
on a table also called Mentors. Yes, I know this is bad
practice but I only learned about using prefixes like
frm, tbl, cbo etc well after Id started designing the
mdb. The problem is I have changed things so that now the
records in table Mentors no longer contain the SchoolID.
Instead I have another table called tblMentorSBTSchool
whose records contain the Mentor ID and the SchoolID.
These records are presented on a subform called
frmMentorSBTSchoolSubform and this subform is imbedded in
the Mentors form, linked by MentorID.
What change could I make to the code to make it open the
Mentor form whose subform record has the same SchoolID.
I also have the same problem in reverse, the Mentor form
also has a button that opens the Schools form where the
SchoolID is the same. I need to change this buttons code
so that it opens the Schools form where the SchoolID is
the same as that shown on the frmMentorSBTSchool subform.
I hope this makes sense. Thanks for the help. Noel
my Access 2002 mdb and now a command button that I set up
on a Schools form to open up a linked Mentors form needs
to be changed. I probably used a wizard to create the
button and code.
The Schools forms buttons relevant On Click code is
stDocName = "Mentors"
stLinkCriteria = "[SchoolID]=" & Me![SchoolID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
As you can see this calls up form Mentors, which is based
on a table also called Mentors. Yes, I know this is bad
practice but I only learned about using prefixes like
frm, tbl, cbo etc well after Id started designing the
mdb. The problem is I have changed things so that now the
records in table Mentors no longer contain the SchoolID.
Instead I have another table called tblMentorSBTSchool
whose records contain the Mentor ID and the SchoolID.
These records are presented on a subform called
frmMentorSBTSchoolSubform and this subform is imbedded in
the Mentors form, linked by MentorID.
What change could I make to the code to make it open the
Mentor form whose subform record has the same SchoolID.
I also have the same problem in reverse, the Mentor form
also has a button that opens the Schools form where the
SchoolID is the same. I need to change this buttons code
so that it opens the Schools form where the SchoolID is
the same as that shown on the frmMentorSBTSchool subform.
I hope this makes sense. Thanks for the help. Noel