Selasa, 23 April 2013

RE: [MS_AccessPros] query criteria from open form

 

Russ-

If RoleID is the Bound Column in the combo box, then all you need is:

WHERE tblRoleList.RoleID = [Forms]![frmRoleList]![Combo4]

Adding a fourth part to the parameter in this case is not valid!

John Viescas, Author

Microsoft Access 2010 Inside Out

Microsoft Access 2007 Inside Out

Microsoft Access 2003 Inside Out

Building Microsoft Access Applications

SQL Queries for Mere Mortals

http://www.viescas.com/

(Paris, France)

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of ghsclass65
Sent: Tuesday, April 23, 2013 6:16 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] query criteria from open form

John,

Yes John I realized that and changed it to RoleID. Also the ComboBox name
was changed, so my SQL now looks like this:

SELECT tblRoleList.RoleID, Names.LastName, Names.FirstName,
tblAssignedRoles.[Yes-No], Names.Active
FROM tblRoleList INNER JOIN ([Names] INNER JOIN tblAssignedRoles ON
Names.NameID = tblAssignedRoles.AssNameID) ON tblRoleList.RoleID =
tblAssignedRoles.AssRoleID
WHERE (((tblRoleList.RoleID)=[Forms]![frmRoleList]![Combo4]![RoleID]));

However, I still get a zero result from the query after making those
corrections.

--- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , John Viescas
<JohnV@...> wrote:
>
> Russ-
>
>
>
> RoleName in your parameter makes no sense.
> [Forms]![frmRoleList]![RolesCmbo] references the current value of the
combo
> box Bound Column. If that's RoleID, then that's all you need to use.
>
>
>
> John Viescas, Author
>
> Microsoft Access 2010 Inside Out
>
> Microsoft Access 2007 Inside Out
>
> Microsoft Access 2003 Inside Out
>
> Building Microsoft Access Applications
>
> SQL Queries for Mere Mortals
>
> http://www.viescas.com/
>
> (Paris, France)
>
>
>
>
>
>
>
> From: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> [mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of ghsclass65
> Sent: Tuesday, April 23, 2013 5:28 PM
> To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> Subject: Re: [MS_AccessPros] query criteria from open form
>
>
>
>
>
> John,
>
> SELECT tblRoleList.RoleID, Names.LastName, Names.FirstName, Names.Active,
> tblAssignedRoles.[Yes-No]
> FROM tblRoleList INNER JOIN ([Names] INNER JOIN tblAssignedRoles ON
> Names.NameID = tblAssignedRoles.AssNameID) ON tblRoleList.RoleID =
> tblAssignedRoles.AssRoleID
> WHERE (((tblRoleList.RoleID)=[Forms]![frmRoleList]![RolesCmbo]![RoleName])
> AND ((Names.Active)=Yes) AND ((tblAssignedRoles.[Yes-No])=Yes));
>
> Russ
>
> --- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> <mailto:MS_Access_Professionals%40yahoogroups.com> , John Viescas
> <JohnV@> wrote:
> >
> > What is the SQL of your query?
> >
> >
> >
> > John Viescas, Author
> >
> > Microsoft Access 2010 Inside Out
> >
> > Microsoft Access 2007 Inside Out
> >
> > Microsoft Access 2003 Inside Out
> >
> > Building Microsoft Access Applications
> >
> > SQL Queries for Mere Mortals
> >
> > http://www.viescas.com/
> >
> > (Paris, France)
> >
> >
> >
> >
> >
> >
> >
> > From: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> <mailto:MS_Access_Professionals%40yahoogroups.com>
> > [mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> <mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of
ghsclass65
> > Sent: Tuesday, April 23, 2013 4:58 PM
> > To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
> <mailto:MS_Access_Professionals%40yahoogroups.com>
> > Subject: [MS_AccessPros] query criteria from open form
> >
> >
> >
> >
> >
> > I'm trying to set up a query that will get it's criteria from an open
> form.
> > I've set the query's criteria to the form's combo box and it's record
ID,
> > but when I run the query I get a dialog box "Enter Parameter Value". I
> > thought the query would use the value from the record that was chosen in
> the
> > form. No?
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
Recent Activity:
MARKETPLACE


.

__,_._,___

Tidak ada komentar:

Posting Komentar