Query Not Working 06-11-07

Hello,

I have set up a query for 1 table.

The field I'm trying to run the query on is a text field.  I enter a name
(="smith, john") I get zero results.  However I have confirmed that this
user exists in the table.

Also (if this helps), this field gets populated via a combo box on a form.
The table being used for the lookup contains a "user" field which is also a
text field

Thanks.



0
CT
6/11/2007 2:30:49 PM
access.queries 6343 articles. 1 followers. Follow

17 Replies
868 Views

Similar Articles

[PageSpeed] 23

sometimes this is caused by a leading blank in the field. It displays very 
narrow.

one solution   sname: TRIM([field])


"CT" <ctroy01@hotmail.com> wrote in message 
news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> Hello,
>
> I have set up a query for 1 table.
>
> The field I'm trying to run the query on is a text field.  I enter a name
> (="smith, john") I get zero results.  However I have confirmed that this
> user exists in the table.
>
> Also (if this helps), this field gets populated via a combo box on a form.
> The table being used for the lookup contains a "user" field which is also 
> a
> text field
>
> Thanks.
>
>
> 


0
David
6/11/2007 2:41:25 PM
Thanks,

I've confirmed there are no leading or trailing spaces in the fields. What
else could be going on?


"David Cox" <nospam@nospam.com> wrote in message
news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> sometimes this is caused by a leading blank in the field. It displays very
> narrow.
>
> one solution   sname: TRIM([field])
>
>
> "CT" <ctroy01@hotmail.com> wrote in message
> news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > Hello,
> >
> > I have set up a query for 1 table.
> >
> > The field I'm trying to run the query on is a text field.  I enter a
name
> > (="smith, john") I get zero results.  However I have confirmed that this
> > user exists in the table.
> >
> > Also (if this helps), this field gets populated via a combo box on a
form.
> > The table being used for the lookup contains a "user" field which is
also
> > a
> > text field
> >
> > Thanks.
> >
> >
> >
>
>


0
CT
6/11/2007 3:20:04 PM
Here is the SQL"

SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
Devices].User
FROM [Table - Mobile Devices]
WHERE ((([Table - Mobile Devices].User)="smith, john"));

Thanks!


"KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
news:1001E2AF-5492-4726-B4CE-284445A2B25A@microsoft.com...
> Post your SQL.
>
> -- 
> KARL DEWEY
> Build a little - Test a little
>
>
> "CT" wrote:
>
> > Thanks,
> >
> > I've confirmed there are no leading or trailing spaces in the fields.
What
> > else could be going on?
> >
> >
> > "David Cox" <nospam@nospam.com> wrote in message
> > news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> > > sometimes this is caused by a leading blank in the field. It displays
very
> > > narrow.
> > >
> > > one solution   sname: TRIM([field])
> > >
> > >
> > > "CT" <ctroy01@hotmail.com> wrote in message
> > > news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > > > Hello,
> > > >
> > > > I have set up a query for 1 table.
> > > >
> > > > The field I'm trying to run the query on is a text field.  I enter a
> > name
> > > > (="smith, john") I get zero results.  However I have confirmed that
this
> > > > user exists in the table.
> > > >
> > > > Also (if this helps), this field gets populated via a combo box on a
> > form.
> > > > The table being used for the lookup contains a "user" field which is
> > also
> > > > a
> > > > text field
> > > >
> > > > Thanks.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >


0
CT
6/11/2007 5:45:01 PM
Maybe there are other errors as David Cox pointed out so try this --
WHERE ((([Table - Mobile Devices].User) Like "smith*"));

-- 
KARL DEWEY
Build a little - Test a little


"CT" wrote:

> Here is the SQL"
> 
> SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
> Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
> Devices].User
> FROM [Table - Mobile Devices]
> WHERE ((([Table - Mobile Devices].User)="smith, john"));
> 
> Thanks!
> 
> 
> "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> news:1001E2AF-5492-4726-B4CE-284445A2B25A@microsoft.com...
> > Post your SQL.
> >
> > -- 
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "CT" wrote:
> >
> > > Thanks,
> > >
> > > I've confirmed there are no leading or trailing spaces in the fields.
> What
> > > else could be going on?
> > >
> > >
> > > "David Cox" <nospam@nospam.com> wrote in message
> > > news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> > > > sometimes this is caused by a leading blank in the field. It displays
> very
> > > > narrow.
> > > >
> > > > one solution   sname: TRIM([field])
> > > >
> > > >
> > > > "CT" <ctroy01@hotmail.com> wrote in message
> > > > news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > > > > Hello,
> > > > >
> > > > > I have set up a query for 1 table.
> > > > >
> > > > > The field I'm trying to run the query on is a text field.  I enter a
> > > name
> > > > > (="smith, john") I get zero results.  However I have confirmed that
> this
> > > > > user exists in the table.
> > > > >
> > > > > Also (if this helps), this field gets populated via a combo box on a
> > > form.
> > > > > The table being used for the lookup contains a "user" field which is
> > > also
> > > > > a
> > > > > text field
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> 
> 
> 
0
Utf
6/11/2007 6:31:02 PM
Thanks Karl..

Tried that..still returned no results.


"KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
news:D8119BC8-E7C9-494F-8282-8BE1A9076C65@microsoft.com...
> Maybe there are other errors as David Cox pointed out so try this --
> WHERE ((([Table - Mobile Devices].User) Like "smith*"));
>
> -- 
> KARL DEWEY
> Build a little - Test a little
>
>
> "CT" wrote:
>
> > Here is the SQL"
> >
> > SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
> > Devices].Model, [Table - Mobile Devices].[Serial Number], [Table -
Mobile
> > Devices].User
> > FROM [Table - Mobile Devices]
> > WHERE ((([Table - Mobile Devices].User)="smith, john"));
> >
> > Thanks!
> >
> >
> > "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> > news:1001E2AF-5492-4726-B4CE-284445A2B25A@microsoft.com...
> > > Post your SQL.
> > >
> > > -- 
> > > KARL DEWEY
> > > Build a little - Test a little
> > >
> > >
> > > "CT" wrote:
> > >
> > > > Thanks,
> > > >
> > > > I've confirmed there are no leading or trailing spaces in the
fields.
> > What
> > > > else could be going on?
> > > >
> > > >
> > > > "David Cox" <nospam@nospam.com> wrote in message
> > > > news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> > > > > sometimes this is caused by a leading blank in the field. It
displays
> > very
> > > > > narrow.
> > > > >
> > > > > one solution   sname: TRIM([field])
> > > > >
> > > > >
> > > > > "CT" <ctroy01@hotmail.com> wrote in message
> > > > > news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > > > > > Hello,
> > > > > >
> > > > > > I have set up a query for 1 table.
> > > > > >
> > > > > > The field I'm trying to run the query on is a text field.  I
enter a
> > > > name
> > > > > > (="smith, john") I get zero results.  However I have confirmed
that
> > this
> > > > > > user exists in the table.
> > > > > >
> > > > > > Also (if this helps), this field gets populated via a combo box
on a
> > > > form.
> > > > > > The table being used for the lookup contains a "user" field
which is
> > > > also
> > > > > > a
> > > > > > text field
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >


0
CT
6/11/2007 6:40:48 PM
Is this a lookup field by chance?  Test it by using >0 as criteria.

If so, then you need add the lookup table and join in your query.  Then add 
the criteria to the name field of the lookup table.
-- 
KARL DEWEY
Build a little - Test a little


"CT" wrote:

> Thanks Karl..
> 
> Tried that..still returned no results.
> 
> 
> "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> news:D8119BC8-E7C9-494F-8282-8BE1A9076C65@microsoft.com...
> > Maybe there are other errors as David Cox pointed out so try this --
> > WHERE ((([Table - Mobile Devices].User) Like "smith*"));
> >
> > -- 
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "CT" wrote:
> >
> > > Here is the SQL"
> > >
> > > SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
> > > Devices].Model, [Table - Mobile Devices].[Serial Number], [Table -
> Mobile
> > > Devices].User
> > > FROM [Table - Mobile Devices]
> > > WHERE ((([Table - Mobile Devices].User)="smith, john"));
> > >
> > > Thanks!
> > >
> > >
> > > "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> > > news:1001E2AF-5492-4726-B4CE-284445A2B25A@microsoft.com...
> > > > Post your SQL.
> > > >
> > > > -- 
> > > > KARL DEWEY
> > > > Build a little - Test a little
> > > >
> > > >
> > > > "CT" wrote:
> > > >
> > > > > Thanks,
> > > > >
> > > > > I've confirmed there are no leading or trailing spaces in the
> fields.
> > > What
> > > > > else could be going on?
> > > > >
> > > > >
> > > > > "David Cox" <nospam@nospam.com> wrote in message
> > > > > news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> > > > > > sometimes this is caused by a leading blank in the field. It
> displays
> > > very
> > > > > > narrow.
> > > > > >
> > > > > > one solution   sname: TRIM([field])
> > > > > >
> > > > > >
> > > > > > "CT" <ctroy01@hotmail.com> wrote in message
> > > > > > news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > > > > > > Hello,
> > > > > > >
> > > > > > > I have set up a query for 1 table.
> > > > > > >
> > > > > > > The field I'm trying to run the query on is a text field.  I
> enter a
> > > > > name
> > > > > > > (="smith, john") I get zero results.  However I have confirmed
> that
> > > this
> > > > > > > user exists in the table.
> > > > > > >
> > > > > > > Also (if this helps), this field gets populated via a combo box
> on a
> > > > > form.
> > > > > > > The table being used for the lookup contains a "user" field
> which is
> > > > > also
> > > > > > > a
> > > > > > > text field
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> 
> 
> 
0
Utf
6/11/2007 6:58:00 PM
On Mon, 11 Jun 2007 13:45:01 -0400, "CT" <ctroy01@hotmail.com> wrote:

>Here is the SQL"
>
>SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
>Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
>Devices].User
>FROM [Table - Mobile Devices]
>WHERE ((([Table - Mobile Devices].User)="smith, john"));

Let me hazard a guess here: the field User in [Table - Mobile Devices] is a
Lookup field. 

If it is, then what the table contains is NOT "smith, john", but rather a
concealed numeric foreign key to the lookup table.

This problem you're having is one of many reasons a lot of us really dislike
the lookup wizard.

             John W. Vinson [MVP]
0
John
6/11/2007 7:15:38 PM
User in [Table - Mobile Devices] is a text field.

On the form I use a combo box to do a lookup on a table named STAFF and have
the selected value stored in the USER field from the Mobile Devices table.




"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:8o7r63lnuc732g7n8tmmusj6rjp06690m6@4ax.com...
> On Mon, 11 Jun 2007 13:45:01 -0400, "CT" <ctroy01@hotmail.com> wrote:
>
> >Here is the SQL"
> >
> >SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
> >Devices].Model, [Table - Mobile Devices].[Serial Number], [Table - Mobile
> >Devices].User
> >FROM [Table - Mobile Devices]
> >WHERE ((([Table - Mobile Devices].User)="smith, john"));
>
> Let me hazard a guess here: the field User in [Table - Mobile Devices] is
a
> Lookup field.
>
> If it is, then what the table contains is NOT "smith, john", but rather a
> concealed numeric foreign key to the lookup table.
>
> This problem you're having is one of many reasons a lot of us really
dislike
> the lookup wizard.
>
>              John W. Vinson [MVP]


0
CT
6/11/2007 8:13:53 PM
Karl,

When I used that criteria, it returned everyone in the table! Making
progress now...at least I'm getting results.

So in your suggested solution, you said to "add the lookup table and join in
your query.  Then add
> the criteria to the name field of the lookup table."  Are you saying to
add the both tables (main table and user table) to the query?  If so, when I
tried to do that I get an error that the tables are not related.


"KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
news:5FDBBB93-9885-4B9F-A802-D2D5008B6996@microsoft.com...
> Is this a lookup field by chance?  Test it by using >0 as criteria.
>
> If so, then you need add the lookup table and join in your query.  Then
add
> the criteria to the name field of the lookup table.
> -- 
> KARL DEWEY
> Build a little - Test a little
>
>
> "CT" wrote:
>
> > Thanks Karl..
> >
> > Tried that..still returned no results.
> >
> >
> > "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> > news:D8119BC8-E7C9-494F-8282-8BE1A9076C65@microsoft.com...
> > > Maybe there are other errors as David Cox pointed out so try this --
> > > WHERE ((([Table - Mobile Devices].User) Like "smith*"));
> > >
> > > -- 
> > > KARL DEWEY
> > > Build a little - Test a little
> > >
> > >
> > > "CT" wrote:
> > >
> > > > Here is the SQL"
> > > >
> > > > SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
> > > > Devices].Model, [Table - Mobile Devices].[Serial Number], [Table -
> > Mobile
> > > > Devices].User
> > > > FROM [Table - Mobile Devices]
> > > > WHERE ((([Table - Mobile Devices].User)="smith, john"));
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> > > > news:1001E2AF-5492-4726-B4CE-284445A2B25A@microsoft.com...
> > > > > Post your SQL.
> > > > >
> > > > > -- 
> > > > > KARL DEWEY
> > > > > Build a little - Test a little
> > > > >
> > > > >
> > > > > "CT" wrote:
> > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > I've confirmed there are no leading or trailing spaces in the
> > fields.
> > > > What
> > > > > > else could be going on?
> > > > > >
> > > > > >
> > > > > > "David Cox" <nospam@nospam.com> wrote in message
> > > > > > news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> > > > > > > sometimes this is caused by a leading blank in the field. It
> > displays
> > > > very
> > > > > > > narrow.
> > > > > > >
> > > > > > > one solution   sname: TRIM([field])
> > > > > > >
> > > > > > >
> > > > > > > "CT" <ctroy01@hotmail.com> wrote in message
> > > > > > > news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > I have set up a query for 1 table.
> > > > > > > >
> > > > > > > > The field I'm trying to run the query on is a text field.  I
> > enter a
> > > > > > name
> > > > > > > > (="smith, john") I get zero results.  However I have
confirmed
> > that
> > > > this
> > > > > > > > user exists in the table.
> > > > > > > >
> > > > > > > > Also (if this helps), this field gets populated via a combo
box
> > on a
> > > > > > form.
> > > > > > > > The table being used for the lookup contains a "user" field
> > which is
> > > > > > also
> > > > > > > > a
> > > > > > > > text field
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >


0
CT
6/11/2007 8:24:43 PM
Based on your post to John you need to join User to Staff.
-- 
KARL DEWEY
Build a little - Test a little


"CT" wrote:

> Karl,
> 
> When I used that criteria, it returned everyone in the table! Making
> progress now...at least I'm getting results.
> 
> So in your suggested solution, you said to "add the lookup table and join in
> your query.  Then add
> > the criteria to the name field of the lookup table."  Are you saying to
> add the both tables (main table and user table) to the query?  If so, when I
> tried to do that I get an error that the tables are not related.
> 
> 
> "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> news:5FDBBB93-9885-4B9F-A802-D2D5008B6996@microsoft.com...
> > Is this a lookup field by chance?  Test it by using >0 as criteria.
> >
> > If so, then you need add the lookup table and join in your query.  Then
> add
> > the criteria to the name field of the lookup table.
> > -- 
> > KARL DEWEY
> > Build a little - Test a little
> >
> >
> > "CT" wrote:
> >
> > > Thanks Karl..
> > >
> > > Tried that..still returned no results.
> > >
> > >
> > > "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> > > news:D8119BC8-E7C9-494F-8282-8BE1A9076C65@microsoft.com...
> > > > Maybe there are other errors as David Cox pointed out so try this --
> > > > WHERE ((([Table - Mobile Devices].User) Like "smith*"));
> > > >
> > > > -- 
> > > > KARL DEWEY
> > > > Build a little - Test a little
> > > >
> > > >
> > > > "CT" wrote:
> > > >
> > > > > Here is the SQL"
> > > > >
> > > > > SELECT [Table - Mobile Devices].Manufacturer, [Table - Mobile
> > > > > Devices].Model, [Table - Mobile Devices].[Serial Number], [Table -
> > > Mobile
> > > > > Devices].User
> > > > > FROM [Table - Mobile Devices]
> > > > > WHERE ((([Table - Mobile Devices].User)="smith, john"));
> > > > >
> > > > > Thanks!
> > > > >
> > > > >
> > > > > "KARL DEWEY" <KARLDEWEY@discussions.microsoft.com> wrote in message
> > > > > news:1001E2AF-5492-4726-B4CE-284445A2B25A@microsoft.com...
> > > > > > Post your SQL.
> > > > > >
> > > > > > -- 
> > > > > > KARL DEWEY
> > > > > > Build a little - Test a little
> > > > > >
> > > > > >
> > > > > > "CT" wrote:
> > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > I've confirmed there are no leading or trailing spaces in the
> > > fields.
> > > > > What
> > > > > > > else could be going on?
> > > > > > >
> > > > > > >
> > > > > > > "David Cox" <nospam@nospam.com> wrote in message
> > > > > > > news:padbi.26455$RP4.16641@newsfe2-win.ntli.net...
> > > > > > > > sometimes this is caused by a leading blank in the field. It
> > > displays
> > > > > very
> > > > > > > > narrow.
> > > > > > > >
> > > > > > > > one solution   sname: TRIM([field])
> > > > > > > >
> > > > > > > >
> > > > > > > > "CT" <ctroy01@hotmail.com> wrote in message
> > > > > > > > news:ODEJHTDrHHA.4836@TK2MSFTNGP05.phx.gbl...
> > > > > > > > > Hello,
> > > > > > > > >
> > > > > > > > > I have set up a query for 1 table.
> > > > > > > > >
> > > > > > > > > The field I'm trying to run the query on is a text field.  I
> > > enter a
> > > > > > > name
> > > > > > > > > (="smith, john") I get zero results.  However I have
> confirmed
> > > that
> > > > > this
> > > > > > > > > user exists in the table.
> > > > > > > > >
> > > > > > > > > Also (if this helps), this field gets populated via a combo
> box
> > > on a
> > > > > > > form.
> > > > > > > > > The table being used for the lookup contains a "user" field
> > > which is
> > > > > > > also
> > > > > > > > > a
> > > > > > > > > text field
> > > > > > > > >
> > > > > > > > > Thanks.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> 
> 
> 
0
Utf
6/11/2007 8:40:02 PM
On Mon, 11 Jun 2007 16:13:53 -0400, "CT" <ctroy01@hotmail.com> wrote:

>User in [Table - Mobile Devices] is a text field.
>
>On the form I use a combo box to do a lookup on a table named STAFF and have
>the selected value stored in the USER field from the Mobile Devices table.

If you open the Mobile Devices table, what is actually stored in the USER
field? "Smith, John" or perhaps a user code like JSMIT? The fact that you're
using a combo box to look up a value suggests the possibility that you're
storing something other than the value displayed by the combo. What's the
combo's RowSource, and what's its bound column?

             John W. Vinson [MVP]
0
John
6/11/2007 10:16:38 PM
There is an actual name (Smith, John) in the USER field in the Mobile
Devices table.

This is what is in the Combo's Row source:
SELECT [Table - DD MOESC Staff List].ID, [Table - DD MOESC Staff List].Names
FROM [Table - DD MOESC Staff List] ORDER BY [Names];

This is what was in the bound column: 1

Thanks !

"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:0bir631e9kuldpikombegceoqmr6ttcnql@4ax.com...
> On Mon, 11 Jun 2007 16:13:53 -0400, "CT" <ctroy01@hotmail.com> wrote:
>
> >User in [Table - Mobile Devices] is a text field.
> >
> >On the form I use a combo box to do a lookup on a table named STAFF and
have
> >the selected value stored in the USER field from the Mobile Devices
table.
>
> If you open the Mobile Devices table, what is actually stored in the USER
> field? "Smith, John" or perhaps a user code like JSMIT? The fact that
you're
> using a combo box to look up a value suggests the possibility that you're
> storing something other than the value displayed by the combo. What's the
> combo's RowSource, and what's its bound column?
>
>              John W. Vinson [MVP]


0
CT
6/12/2007 4:19:05 PM
On Tue, 12 Jun 2007 12:19:05 -0400, "CT" <ctroy01@hotmail.com> wrote:

>There is an actual name (Smith, John) in the USER field in the Mobile
>Devices table.
>
>This is what is in the Combo's Row source:
>SELECT [Table - DD MOESC Staff List].ID, [Table - DD MOESC Staff List].Names
>FROM [Table - DD MOESC Staff List] ORDER BY [Names];
>
>This is what was in the bound column: 1

In that case you are NOT storing the User Name into the bound column of the
combo box; you are storing the ID.

What you *SEE* is the second column - the name; what's actually in the table
is the ID, presumably a Long Integer number. A query criterion of "Smith,
John" will not match an ID of 431.

Please, again: check the definition of the table being used as this form's
recordsource (not [Table - DD MOESC Staff List] but the main form's table).
Select the User Name field. Look on the "Lookup" tab in the field properties.
Does it say Combo Box? 

If so, you are yet another victim of Microsoft's misdesigned, misleading,
infuriating Lookup Field misfeature. The table does not contain what it
appears to contain!

             John W. Vinson [MVP]
0
John
6/12/2007 7:47:24 PM
Yes..it says COMBO box.  So what are my options to correct this? I really 
need to be able to query this table using the staff's name.

Thanks for hanging in there with me on this problem!


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message 
news:istt63pcbhg4qod37np5m3mvdglov3n21u@4ax.com...
> On Tue, 12 Jun 2007 12:19:05 -0400, "CT" <ctroy01@hotmail.com> wrote:
>
>>There is an actual name (Smith, John) in the USER field in the Mobile
>>Devices table.
>>
>>This is what is in the Combo's Row source:
>>SELECT [Table - DD MOESC Staff List].ID, [Table - DD MOESC Staff 
>>List].Names
>>FROM [Table - DD MOESC Staff List] ORDER BY [Names];
>>
>>This is what was in the bound column: 1
>
> In that case you are NOT storing the User Name into the bound column of 
> the
> combo box; you are storing the ID.
>
> What you *SEE* is the second column - the name; what's actually in the 
> table
> is the ID, presumably a Long Integer number. A query criterion of "Smith,
> John" will not match an ID of 431.
>
> Please, again: check the definition of the table being used as this form's
> recordsource (not [Table - DD MOESC Staff List] but the main form's 
> table).
> Select the User Name field. Look on the "Lookup" tab in the field 
> properties.
> Does it say Combo Box?
>
> If so, you are yet another victim of Microsoft's misdesigned, misleading,
> infuriating Lookup Field misfeature. The table does not contain what it
> appears to contain!
>
>             John W. Vinson [MVP] 


0
CT
6/17/2007 2:14:18 AM
On Sat, 16 Jun 2007 22:14:18 -0400, "CT" <ctroy01@hotmail.com> wrote:

>Yes..it says COMBO box.  So what are my options to correct this? I really 
>need to be able to query this table using the staff's name.

You can't query *that table* for the staff name  - because that table *DOES
NOT CONTAIN* the staff name, in any way, shape, or form.

The field which *appears* to contain the staff name actually contains a long
integer StaffID. The Lookup Wizard has concealed that very basic fact from
view by displaying data *from a different table*, the lookup table.

The solution? Instead of looking for the staff name where it isn't, either
look for it where it *is* - by creating a query joining your main table to the
lookup table; or, use an unbound Combo Box on a form to let the user select a
StaffID (while seeing only the staff name), and use

=Forms![nameofform]![nameofcombobox]

as a criterion in your query, to search for the ID value (which is in fact in
your table).

             John W. Vinson [MVP]
0
John
6/17/2007 4:18:55 AM
I think I got it now! Thanks for your help!


"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:ead973h3b7oljskbpobd0436u8c47gha5p@4ax.com...
> On Sat, 16 Jun 2007 22:14:18 -0400, "CT" <ctroy01@hotmail.com> wrote:
>
> >Yes..it says COMBO box.  So what are my options to correct this? I really
> >need to be able to query this table using the staff's name.
>
> You can't query *that table* for the staff name  - because that table
*DOES
> NOT CONTAIN* the staff name, in any way, shape, or form.
>
> The field which *appears* to contain the staff name actually contains a
long
> integer StaffID. The Lookup Wizard has concealed that very basic fact from
> view by displaying data *from a different table*, the lookup table.
>
> The solution? Instead of looking for the staff name where it isn't, either
> look for it where it *is* - by creating a query joining your main table to
the
> lookup table; or, use an unbound Combo Box on a form to let the user
select a
> StaffID (while seeing only the staff name), and use
>
> =Forms![nameofform]![nameofcombobox]
>
> as a criterion in your query, to search for the ID value (which is in fact
in
> your table).
>
>              John W. Vinson [MVP]


0
CT
6/18/2007 6:42:54 PM
Thanks for the info.
"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:ead973h3b7oljskbpobd0436u8c47gha5p@4ax.com...
> On Sat, 16 Jun 2007 22:14:18 -0400, "CT" <ctroy01@hotmail.com> wrote:
>
> >Yes..it says COMBO box.  So what are my options to correct this? I really
> >need to be able to query this table using the staff's name.
>
> You can't query *that table* for the staff name  - because that table
*DOES
> NOT CONTAIN* the staff name, in any way, shape, or form.
>
> The field which *appears* to contain the staff name actually contains a
long
> integer StaffID. The Lookup Wizard has concealed that very basic fact from
> view by displaying data *from a different table*, the lookup table.
>
> The solution? Instead of looking for the staff name where it isn't, either
> look for it where it *is* - by creating a query joining your main table to
the
> lookup table; or, use an unbound Combo Box on a form to let the user
select a
> StaffID (while seeing only the staff name), and use
>
> =Forms![nameofform]![nameofcombobox]
>
> as a criterion in your query, to search for the ID value (which is in fact
in
> your table).
>
>              John W. Vinson [MVP]


0
Scott
6/18/2007 6:43:46 PM
Reply:

Similar Artilces:

Drillthrough report using "Jump to URL" quits working when Parent Report Parameter values are changed
I have a summary report that lists totals and the report has the ability to drillthrough to another "details" report by clicking the numbers on the summary report. The details report is rendered in a separate window using "Jump to URL" and passing the parameters from the summary report to the details report. This has worked fine for some time, but my problem is I need to modify the values of one of the report parameters that is used by the summary report and passed to the detail report. When I modify the parameter "value" and deploy the report the ...

Timer for Queries?
Does anyone know of a macro or add-on that I could use as a simple timer for queries? I don't like to use the CPU time in the Task Manager because of it's inaccuracy when not receiving full CPU usage. THanks for any suggestions -- cmungs Exactly what are you trying to accomplish? Are you trying to cause a query to run automatically every so often? If so, you will need to use the timer event on a form to do that. -- Lynn Trapp Microsoft MVP (Access) www.ltcomputerdesigns.com "cmungs" <cmungs@discussions.microsoft.com> wrote in message news:88EC7019-045F-4EF...

Working out UK tax
ive set up a spreadsheet to calculate my income per week. I now would like to make my tax and national insurance boxes to be calculated automatically. meaning all im required to do is type in my hours worked for that week. The problem is finding a formula that can do this. The UK tax and national insurance is directly proportional to how much you earn. Not one fixed percentage. Let me show us some numbers: - Payslip 1 Total Pay = 297.62 Tax = 40.65 = 13.7% N.I = 22.73 = 7.6% Payslip 2 Total Pay = 242.63 Tax =...

help!! forwarding rules do not work!
Hello, i have set a rule so that when i receive from a certain sender, i have it set to forward to an email address that is outside the domain. but the rule will not forward it. it will sometimes work if i use the "run now" button but never automatically. what should i do. the altimate goal is to have message from certain people auto forward to a moble device's email account. thanks jon ...

Erratic results from query criteria
I am getting different results from running the same query with the same selections. One moment it is all behaving as expected, the next it has gone haywire. (I have done what appears to me to be EXACTLY what I have done in another database, where it works perfectly every single time.) In a query I have, amongst others, the following fields: Category SubCategory Company I want to be able to select any OR ALL of the relevant fields. I have the following criteria: Like "*"&[Type Category otherwise leave blank for ALL]&"*" Like "*"&a...

Update Query ?
Is there a way to 1) Assign events when adding in data thru an update query for example if you append a bunch of data into a table could you then do some kind of an update query to say if there is an initial event and no others tag this one Renewal 1 etc.. the only real data you have to go on would be Customer A and the total amt .. the event, renewal event and the delta would all need to be added in example: Say Customer A comes in with an initial deal then Customer A renews their deal So, the data would look like when you're done.: Year Custo...

Remove-Item -recurse still doesn't work?
I remember having issues with remove-item -recurse in v1, but directly from get-help remove-item in v2: "The Recurse parameter in this cmdlet does not work properly." .... C:\PS>get-childitem * -include *.csv -recurse | remove-item .... Because the Recurse parameter in this cmdlet is faulty, the command uses the Get-Childitem cmdlet to get the desired files, and it uses the pipeline operator to pass them to the Remove-Item cmdlet. and yet this filed bug: http://connect.microsoft.com/PowerShell/feedback/details/87456/remove-item-recurse-and-copy-item-recurse-exclud...

design query match anywhere?
In the design query I want to match the letters "ABC" anywhere in the column 'description'. I could not get instr to work by using: InStr(description, "ABC")) > 0 How else can I match ABC (upper and lowercase) to anywhere in my 'description' column? Thanks! Are you saying you put that InStr bit as a criteria under your Description field in the query designer? Try putting Like "*ABC*" as the criteria instead. Alternatively, you could add a computed field to the query InStr([Description, "ABC") and then put >0 as the ...

Windows Media Player 11 stopped working
As near as I can tell, I have WMP version 11.0.6002.18111 installed on my Vista Home Premium system. I haven't used it in a while, so I'm not sure when the problem arose, but whenever I try to play a file or even just open the player, I'm informed it has stopped working with the following information provided: roblem Event Name: APPCRASH Application Name: wmplayer.exe Application Version: 11.0.6002.18111 Application Timestamp: 4aa91411 Fault Module Name: kernel32.dll Fault Module Version: 6.0.6002.18005 Fault Module Timestamp: 49e037dd Exception Cod...

Unexpected Error- Running Advance Find Query
I am getting a message that says "Unexpected Error An Error has occurred" when I am running an advanced find query on two custom entities. It seems to be when I have certain custom fields included in my view that the query errors out. Any help on this would be greatly appreciated. Thanks so much. Just wanted to add that I seem to get errors when there is a 0.00 amount in these fields... "TJ" wrote: > I am getting a message that says "Unexpected Error An Error has occurred" > when I am running an advanced find query on two custom entities. It se...

Time calculations for Scheduled vs Actual Employee Time and Wages 11-29-09
I am THRYING to make a simple schedule worksheet for a manger to use to calculate the time he schedules an employee to clock in and out and what it will cost him in regards to his allocated budget and then to be able to compare it after the job is completed. BUT time calculations have thrown me for loop and I am stuck for hours on trying to calculate time fields. PLEASE DEAR GOD can someone help me. Below is a simple example of my worksheet. A2 (Time IN) = 1:00 PM A3 (Time OUT) = 5:00 PM A4 (Time Worked) = 4:00 (h:mm format) Formula A3...

CRM Data Migration 11-03-04
Hi, I would like to enquire how long will I need to take to migrate data from a table in an access database to MS CRM? For instance I wana migrate 10 columns in customer table in access database to MSCRM. How much effort need to be done? As I have not done any data migration before. So wat do I need to do n prep myself in order to start the data migration for my customer? any guidelines to assist me? Kindly assist me pls. thanks Johnson Dear Johnson, You should take a look at the data migration framework. This is on a cd which is delivered with crm, or you can download it from t...

pass through query
If a combobox is populated by a pass-through query, does it requery every time the form is closed and reopened? Thanks, Sam Yes. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Sam wrote: > If a combobox is populated by a pass-through query, does it requery every > time the form is closed and reopened? > Thanks, > Sam ...

a count field in a query?
Hello, I have a query in which I would like to create a field which increments by 1 for each record selected, so if there are 10 records selected by the query, this column would show numbers 1 to 10. Ideally I would like to have some text in front of each number, say invoice1, invoice2 etc. From a previous posting I realise that this is frowned upon but it would be the simplest solution for my problem! How can I do this? Thanks Geoff On Mon, 03 Dec 2007 08:54:00 +0000, Geoff Cox <<>> wrote: >Hello, > >I have a query in which I would like to create a field which >...

E-mail hyperlinks won't work
I upgraded from Outlook 2000 to 2002 with my new PocketPC installation. Now when I click on any highlighted hyperlinks within a recvd e-mail msg, a dialog box pops up and it appears to start an unpacking tool to run an install for Acrobat Reader all on its own. It does with any hyperlink selected from any msg. Does anyone know where you go in to fix this. Thanks, Chris ...

Saving Username and Pass with Web Queries
I am pulling data from a website that requires you to provide a usernam and password everytime you visit the site. Excel has cachin capabilities, but everytime you close excel and try and open up th spreadsheet again, it can't login. What is the fix for this? Thanks, Hend -- Message posted from http://www.ExcelForum.com Bump! --- Message posted from http://www.ExcelForum.com/ ...

Birthday query for many children in one record
I have a database for the church, it has one main flat table only. Each record for the parents have field for child1 name, child1birthday, child2 name, child2birthday, child3 name, child3birthday - up to 5 children. I am having difficulty trying to get a report to list the birthdays of the children like this parent name, child 1 name, child 1 birthday month etc. so you get something like this:- Parent John Smith, child Mary Smith January 3 Parent Fred Jones, child Bert Jones March 4 Parent John Smith, child Jane Smith March 6 Parent Harry Brown, child Jane Brown March 6 Parent Bert Taylor,...

Unresponsive Query Wizard
Hi there, I have an Excel 2003 user who is using a spreadsheet that pulls data from our SQL server. When he opens it and refreshes the data it is fine, it pulls the current data, but when he tries to edit the query, the Query Wizard does not appear, he can see it on the task bar, but when he switches focus using task manager everything is greyed out and nothing works. I have tested the file from my computer and it is fine, which suggests a problem with his machine or installation. Does anyone have any ideas? Cheers, Steve Dooza wrote: > Hi there, > I have an Excel 2003 user who...

Another simple query
Dear all, I have a table that contains first names and last names in different fields. Is there any way to write a query that will give as a result the first name and last name in the same field? I hope this makes sense. Thanks in advance! SELECT [last_name_field] & ", " & [first_name_field] AS whole_name FROM [your_name_table] Change the field and table names to whatever your actual fields and tables are. Cheers, Jason Lepack On Apr 23, 9:47 am, Homer <peter.a.r...@googlemail.com> wrote: > Dear all, > > I have a table that contains first names an...

Entourage doesn't even try connect to Exchange server
Hi! My colleague has trouble with Entourage 2008 (12.2.3). Since a week back he cannot connect to Exchange anymore. Usually when we start up Entourage and it connects to the Exchange server it warns that there's no root certificate installed and in that dialog we press �OK� and get connected anyway. Now this has stopped working and we've done all I know of ��reinstalled Office 2008 and re-applied the updates, removed all preferences for Entourage and Office, removed the �Microsoft User Data� folder and tried setting things up from scratch. No go. But. It works just f...

Query query
I am trying to create a new field in which it shows the sum total of 10 fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest way to do this? -- Joe NewFieldName: [Charge Time] + [Charge Time 2] + [Charge Time 3] .... etc -- Good Luck BS"D "joet5402" wrote: > I am trying to create a new field in which it shows the sum total of 10 > fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest > way to do this? > -- > Joe I tried this, and it doesn't work. Is there something I'm forgetting? -- Joe ...

working with excel
i am using check boxs for yes and no questions,how do i simplify the size and centering them on a row and column? There are two different checkboxes--one from the controltoolbox toolbar and one from the forms toolbar. This code will fill the topleft cell with the checkbox: Option Explicit Sub testme1() Dim OLEObj As OLEObject Dim myCBX As CheckBox For Each OLEObj In ActiveSheet.OLEObjects If TypeOf OLEObj.Object Is MSForms.CheckBox Then With OLEObj .Top = .TopLeftCell.Top .Height = .TopLeftCell.Height .Wi...

To Query or not to Query??
Hello all - I'm a newbe to Access but have made great progress. I'm using Acess 2003. The db is up and running prefectly. Now I need to tackle the reporting. I have seen posts about reports and queries and am a little confused. Do I need to create a query to run my reports off of? I have a tabbed subform in the main form. There are seven tabs breaking up all the services we provide. Like "Promo Items", "Leads", "Client Printed Material","Internal Print Material" and so on. The main form has the User, Branch and Marketing Rep. I need to...

group by query trouble
I'm trying to run a query that counts the number of people with hemoglobin of type SS, type SC, and then all others. There are about 12 different kinds of types. Basically I want a count for SS, a count for SC, and then a count that totals all the others into one count. Hopefully that makes sense. I'm using group by for the SS and SC which works great, but I'm not sure how to tell it to add up the others. I'm not a big fan of nested IIf statements, but this should work after you put in the proper field and table names: SELECT IIf([Hemoglobin]="SC","SC&...

Dynamic Query
Hi! I am trying to dynamically modify my pass-through query containing a procedure call with 2 parameters. When I run my access app, I get this error: "Object or provider is not capable of performing reuqested operation." Below is my access code: Dim varItem As Variant Dim strSQL As String Dim cat As ADOX.Catalog Dim cmd As ADODB.Command Dim strMyDate As String, dtMyDate As Date dtMyDate = CDate([Forms]![ySalesHistory]![Start Date]) strMyDate = Format(dtMyDate, "yyyymmdd") strSQL = "procCustomerSalesandPayments '" & s...