Inserting an OR operator into an event procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

First, some background:

All teachers can author a multiple number of projects, and can be the lead
author or co-author for each project.

I have 2 tables - TBL projects and TBL teachers. Projects looks up teacher
name sfrom TBL Teachers by Teacher ID.

There are 2 forms - FRM Teachers and FRM Projects

Below is the visual basic that access has given me for a button to open FRM
Projects from FRM Teachers, filtering for all projects "Lead Authored" by the
teacher on display. I want to filter for all projects lead authored or co
authored by the tutor. So I need to find a way of changing "[Lead Author ID]"
to "[Lead Author ID] or [Co-Author ID]" without mucking up the syntax.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FRM Projects"

stLinkCriteria = "[Lead Author ID]=" & Me![Teacher ID]

DoCmd.OpenForm stDocName, , , stLinkCriteria
 
stLinkCriteria = "[Lead Author ID]=" & Me![Teacher ID] & " Or [Co-Author ID]
= " & Me![Teacher ID]
 
Back
Top