Lookup for data and put in a table

K

Kentucky5

I have one table and I want to do a lookup in a memo field
for example: P035, If I find that code I want to put it
in another field located in the table and mark another
field with a Y. If no codes are found I want to mark a N
in the field in the table.

Any help would be greatly appreciated.
 
G

Guest

Kentucky

I am not sure if I have really understood this. The problem I see is if you only have one table and you don't find the requested Memo field then there is no record in which to insert the 'N'.

If you are inserting the Memo and the Y/N in a second table then this is a differeint story.

Regards
Rowan
 
K

Kentucky5

Actually within my one table I want to search for data
with the memo field example P035 which I would do a search
like P035* if it exists I want to place this code in
another field with the table and mark another field with a
Y, and if no codes are found put a N in the same field.

Is this more clear?
-----Original Message-----
Kentucky

I am not sure if I have really understood this. The
problem I see is if you only have one table and you don't
find the requested Memo field then there is no record in
which to insert the 'N'.
If you are inserting the Memo and the Y/N in a second
table then this is a differeint story.
 
J

John Vinson

I have one table and I want to do a lookup in a memo field
for example: P035, If I find that code I want to put it
in another field located in the table and mark another
field with a Y. If no codes are found I want to mark a N
in the field in the table.

Any help would be greatly appreciated.

An UPDATE query will work: create a Query based on your table with a
criterion of

LIKE "*P035*"

on the memo field, and "Y" on the UpdateTo line.
 
K

Kentucky5

I don't think that this works, I have two fields that I
need to check Simultaneously. The Po Code and be in
either of these fields.

Thanks for your time
 
J

John Vinson

I don't think that this works, I have two fields that I
need to check Simultaneously. The Po Code and be in
either of these fields.

In that case your table is incorrectly designed... and you didn't say
that in your question. We're not telepathic, and we cannot see your
database!

Please explain WHERE you want to find this data, and just what you
want to accomplish; include enough description of your table structure
to allow someone to give a useful answer.
 
K

Kentucky5

I apologize for not being clear. Let me attempt to
explain. There are two memo fields that are basically
comments but in the one field it represents the general
complaint and in the other memo field describes the
technical side of the problem. Depending who is entering
the data they might decide to put the data I am searching
for in either one or both of the fields. Let me give an
example:

Primary Memo Field Memo Field
ID General Comments Technical Comments
512 P035 Hard Start
613 Shutters P060

I hope this helps explain what I am trying to do.

Again I apologize for not being clear.
 
J

John Vinson

Depending who is entering
the data they might decide to put the data I am searching
for in either one or both of the fields. Let me give an
example:

Primary Memo Field Memo Field
ID General Comments Technical Comments
512 P035 Hard Start
613 Shutters P060

Thanks, that helps!

You just need an OR clause; in the query grid put

LIKE "*" & [Enter code:] & "*"

under both [General Comments] and [Technical Comments], on *separate*
lines in the query grid so it uses OR logic. The SQL would be

WHERE [General Comments] LIKE "*" & [Enter code:] & "*" OR [Technical
Comments] LIKE "*" & [Enter code:] & "*"
 

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