Query for entering keyword to take to record?

G

Guest

Hi,

I'm hoping someone can help me out with my problem - I'd be most grateful.
I am trying to run a query which prompts the user to type in a keyword of a
title of a medical study. I tried a parameter query but I do not know how to
make it work so that, for example, only the records will come up which have
the word 'diabetes' in its title. My query brings up nothing when you type in
diabetes - it requires you to type in the whole title! Can anyone tell me
what I should be putting into the criteria?
Kind regards,
Liz.
 
G

Guest

Use Like in the Query

Select * From TableName Where FieldName Like "*" & [Please enter a word:] &
"*"
 
G

Guest

Thanks for replying. I copied what you suggested into the criteria and put
the table name and field name in but it says the syntax is incorrect. Have I
done something wrong:

Select * From Study details Where ProjectTitle Like "*" & [Please enter a
word:] &

Thanks.
Liz.
Ofer said:
Use Like in the Query

Select * From TableName Where FieldName Like "*" & [Please enter a word:] &
"*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Hi,

I'm hoping someone can help me out with my problem - I'd be most grateful.
I am trying to run a query which prompts the user to type in a keyword of a
title of a medical study. I tried a parameter query but I do not know how to
make it work so that, for example, only the records will come up which have
the word 'diabetes' in its title. My query brings up nothing when you type in
diabetes - it requires you to type in the whole title! Can anyone tell me
what I should be putting into the criteria?
Kind regards,
Liz.
 
G

Guest

Try this, if the name contain two separate names it need to be in square
brackets

Select * From [Study details] Where ProjectTitle Like "*" & [Please enter a
word:] & "*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Thanks for replying. I copied what you suggested into the criteria and put
the table name and field name in but it says the syntax is incorrect. Have I
done something wrong:

Select * From Study details Where ProjectTitle Like "*" & [Please enter a
word:] &

Thanks.
Liz.
Ofer said:
Use Like in the Query

Select * From TableName Where FieldName Like "*" & [Please enter a word:] &
"*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Hi,

I'm hoping someone can help me out with my problem - I'd be most grateful.
I am trying to run a query which prompts the user to type in a keyword of a
title of a medical study. I tried a parameter query but I do not know how to
make it work so that, for example, only the records will come up which have
the word 'diabetes' in its title. My query brings up nothing when you type in
diabetes - it requires you to type in the whole title! Can anyone tell me
what I should be putting into the criteria?
Kind regards,
Liz.
 
G

Guest

Hi,

Thanks a lot for your help. The query still wouldn't run but I took out the
first bits and put:

Like "*" & [Please enter a word:] & "*"

It now works a treat - thank you!
How do I mark your help as an answer?
Regards,
Liz.
Ofer said:
Try this, if the name contain two separate names it need to be in square
brackets

Select * From [Study details] Where ProjectTitle Like "*" & [Please enter a
word:] & "*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Thanks for replying. I copied what you suggested into the criteria and put
the table name and field name in but it says the syntax is incorrect. Have I
done something wrong:

Select * From Study details Where ProjectTitle Like "*" & [Please enter a
word:] &

Thanks.
Liz.
Ofer said:
Use Like in the Query

Select * From TableName Where FieldName Like "*" & [Please enter a word:] &
"*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



:

Hi,

I'm hoping someone can help me out with my problem - I'd be most grateful.
I am trying to run a query which prompts the user to type in a keyword of a
title of a medical study. I tried a parameter query but I do not know how to
make it work so that, for example, only the records will come up which have
the word 'diabetes' in its title. My query brings up nothing when you type in
diabetes - it requires you to type in the whole title! Can anyone tell me
what I should be putting into the criteria?
Kind regards,
Liz.
 
G

Guest

I'm glad it worked out
On the buttom of the box of my replay,there is a blue line, in it, it asked
if I answered your question, mark it as Yes.
Thank you
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Hi,

Thanks a lot for your help. The query still wouldn't run but I took out the
first bits and put:

Like "*" & [Please enter a word:] & "*"

It now works a treat - thank you!
How do I mark your help as an answer?
Regards,
Liz.
Ofer said:
Try this, if the name contain two separate names it need to be in square
brackets

Select * From [Study details] Where ProjectTitle Like "*" & [Please enter a
word:] & "*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Thanks for replying. I copied what you suggested into the criteria and put
the table name and field name in but it says the syntax is incorrect. Have I
done something wrong:

Select * From Study details Where ProjectTitle Like "*" & [Please enter a
word:] &

Thanks.
Liz.
:

Use Like in the Query

Select * From TableName Where FieldName Like "*" & [Please enter a word:] &
"*"
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck



:

Hi,

I'm hoping someone can help me out with my problem - I'd be most grateful.
I am trying to run a query which prompts the user to type in a keyword of a
title of a medical study. I tried a parameter query but I do not know how to
make it work so that, for example, only the records will come up which have
the word 'diabetes' in its title. My query brings up nothing when you type in
diabetes - it requires you to type in the whole title! Can anyone tell me
what I should be putting into the criteria?
Kind regards,
Liz.
 
J

John Spencer

Pardon me for jumping in - I think the poster is putting the entrie SQL
statement into the criteria "cell" on the grid.

Liverlass3981,

If that is the case, try the following

Field: TitleField
Table: YourTableName
Criteria: LIKE "*" & [Please enter a word:] & "*"

Ofer said:
Try this, if the name contain two separate names it need to be in square
brackets

Select * From [Study details] Where ProjectTitle Like "*" & [Please enter
a
word:] & "*"
--
If I answered your question, please mark it as an answer. That way, it
will
stay saved for a longer time, so other can benifit from it.

Good luck



Liverlass3981 said:
Thanks for replying. I copied what you suggested into the criteria and
put
the table name and field name in but it says the syntax is incorrect.
Have I
done something wrong:

Select * From Study details Where ProjectTitle Like "*" & [Please enter a
word:] &

Thanks.
Liz.
Ofer said:
Use Like in the Query

Select * From TableName Where FieldName Like "*" & [Please enter a
word:] &
"*"
--
If I answered your question, please mark it as an answer. That way, it
will
stay saved for a longer time, so other can benifit from it.

Good luck



:

Hi,

I'm hoping someone can help me out with my problem - I'd be most
grateful.
I am trying to run a query which prompts the user to type in a
keyword of a
title of a medical study. I tried a parameter query but I do not know
how to
make it work so that, for example, only the records will come up
which have
the word 'diabetes' in its title. My query brings up nothing when you
type in
diabetes - it requires you to type in the whole title! Can anyone
tell me
what I should be putting into the criteria?
Kind regards,
Liz.
 

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