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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|