Mod to Linked Forms code

J

JohnB

Hi. Can anyone suggest a modification to the following code please? Its part
of the On Click event of a command button on a form that opens a second form,
frmPlacementsBySchool. This second form has a subform called
frmPlacementsSubform with a combo called cboSubject. (The control source of
cboSubject is a table and the choice of a particular subject puts SubjectID
in a field of the same name in tblPlacements). In addition to the existing
criteria (SchoolID) I want frmPlacementsBySchool to open and show only those
subform records that show "Maths" (which is SubjectID 7) in the combo. How
would I do that? I'm using Access 2002 on XP.

Thanks, JohnB

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmPlacementsBySchool"

stLinkCriteria = "[SchoolID]=" & Me![SchoolID]

DoCmd.OpenForm stDocName, , , stLinkCriteria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top