A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how to allow the user to enter their search criteria



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2009, 04:44 PM posted to microsoft.public.access.queries
No1momof3
external usenet poster
 
Posts: 3
Default how to allow the user to enter their search criteria

HI
I have wached the video showing me how the user of the DB can enter their
own dates to perform a query but I need to know how the user of my database
can enter for example their own "Country" or "insitution" so that they can
find for example - all students who have went to "Japan" or "Kyoto
University".

My columns are headed "Country" and "institution" - i tried for example
"=[Country]" it worked the first time and allowed the user to enter the
country but then it stopped and didn't give a search option at all - clicking
on the query just brough up al the records.

  #2  
Old November 30th, 2009, 05:12 PM posted to microsoft.public.access.queries
Jackie L
external usenet poster
 
Posts: 148
Default how to allow the user to enter their search criteria

Create a form with unbound fields for Country and Institution. Then create a
query which refers to those fields as its criteria. For example, for the
field country, in the criteria you could have:

Like "*" & [Forms]![frmNewForm]![Country] &"*"

On the after update event of the unbound field, or on a button on your form,
you could have the code to open the query or a report based off your query.

If you want a range of data create unbound fields BegCountry and EndCountry
on your form. Then the criteria string in the query would be:

Between [Forms]![frmNewForm]![BegCountry] and
[Forms]![frmNewForm]![EndCountry]

Hope this helps

"No1momof3" wrote:

HI
I have wached the video showing me how the user of the DB can enter their
own dates to perform a query but I need to know how the user of my database
can enter for example their own "Country" or "insitution" so that they can
find for example - all students who have went to "Japan" or "Kyoto
University".

My columns are headed "Country" and "institution" - i tried for example
"=[Country]" it worked the first time and allowed the user to enter the
country but then it stopped and didn't give a search option at all - clicking
on the query just brough up al the records.

  #3  
Old November 30th, 2009, 05:19 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default how to allow the user to enter their search criteria

No1momof3 wrote:
HI
I have wached the video showing me how the user of the DB can enter
their own dates to perform a query but I need to know how the user of
my database can enter for example their own "Country" or "insitution"
so that they can find for example - all students who have went to
"Japan" or "Kyoto University".

My columns are headed "Country" and "institution" - i tried for
example "=[Country]" it worked the first time and allowed the user to
enter the country but then it stopped and didn't give a search option
at all - clicking on the query just brough up al the records.


I'm surprised it worked the first time. This can only work when the
parameter name is different from any of the objects in the query's
scope. In this case, you said "=[Country]" ... well, "Country" is the
name of a field in your table, so Access has no reason to prompt for a
value. If you had said this instead it would have worked:
=[Enter country name]
--
HTH,
Bob Barrows


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.