From: cutepaloma405 via AccessMonster.com on
I have two forms: frmStudent and frmCourse. What I want to do is link
frmStudent and frmCourse through the EmployeeID control to get a filter of
each student's courses. Problem: EmployeeID is a string. What I am doing
wrong with the below cited?

stLinkCriteria = "[EmployeeID] = " & Me![EmployeeID]
DoCmd.OpenForm stDocName, , , , acNormal, , stLinkCriteria
DoCmd.ApplyFilter , "EmployeeID="", & EmployeeID & """

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1

From: johnlute on
On Jan 27, 12:44 pm, "cutepaloma405 via AccessMonster.com"
<u56947(a)uwe> wrote:
> I have two forms: frmStudent and frmCourse.  What I want to do is link
> frmStudent and frmCourse through the EmployeeID control to get a filter of
> each student's courses.  Problem:  EmployeeID is a string.  What I am doing
> wrong with the below cited?
>
> stLinkCriteria = "[EmployeeID] = " & Me![EmployeeID]
> DoCmd.OpenForm stDocName, , , , acNormal, , stLinkCriteria
> DoCmd.ApplyFilter , "EmployeeID="", & EmployeeID & """
>
> --
> Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1

What is currently in your frmStudent's Link Master and Link Child
fields...?
From: Dorian on
You need string delimiters (apostrophes) around the value:

stLinkCriteria = "[EmployeeID] = '" & Me![EmployeeID] & "'"

I'm not sure why you are using link criteria and a filter, you only need one
or the other.

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"cutepaloma405 via AccessMonster.com" wrote:

> I have two forms: frmStudent and frmCourse. What I want to do is link
> frmStudent and frmCourse through the EmployeeID control to get a filter of
> each student's courses. Problem: EmployeeID is a string. What I am doing
> wrong with the below cited?
>
> stLinkCriteria = "[EmployeeID] = " & Me![EmployeeID]
> DoCmd.OpenForm stDocName, , , , acNormal, , stLinkCriteria
> DoCmd.ApplyFilter , "EmployeeID="", & EmployeeID & """
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1
>
> .
>
From: AccessVandal via AccessMonster.com on
Use the FilterName or WhereCondition instead of the OpenArgs. The below shows
the WhereCondition. If EmployeeID is Numeric, if not you need the quotes.

stLinkCriteria = "[EmployeeID] = " & Me![EmployeeID]
DoCmd.OpenForm stDocName, , ,stLinkCriteria

Don't need the ApplyFilter as the Form may not be in the correct focus.

cutepaloma405 wrote:
>I have two forms: frmStudent and frmCourse. What I want to do is link
>frmStudent and frmCourse through the EmployeeID control to get a filter of
>each student's courses. Problem: EmployeeID is a string. What I am doing
>wrong with the below cited?
>
>stLinkCriteria = "[EmployeeID] = " & Me![EmployeeID]
>DoCmd.OpenForm stDocName, , , , acNormal, , stLinkCriteria
>DoCmd.ApplyFilter , "EmployeeID="", & EmployeeID & """

--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1