My Assistant
![]() ![]() |
|
|
Mar 16 2012, 03:51 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 166 |
I have created this search form that now works, i finaly got it to work.
However what i want to know how to do is the following. When I clcik the seach button i want it to show the quer results in a form/report instead, so how do i get the command button to run the query but open the report up to show the results. See attached database. Search form is called search and its linked to query league search lol
Attached File(s)
|
|
|
|
Mar 16 2012, 04:17 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 8,192 From: Pacific NorthWet |
This is gonna be one of those <V8> moments (you know, the sound of your hand hitting your forehead ...)
Open the report in design view. Make the query the source (I'm guessing you have a table as a source now). Open the form in design view. "Behind" the command button, put in code to open the report. When you click the button, Access opens the report. When the report opens, it looks to the query for its data. ?<V8>? |
|
|
|
Mar 16 2012, 06:25 PM
Post
#3
|
|
|
UtterAccess Addict Posts: 166 |
OK thanks I got that working, fine now
If with the report open and i change the search criteria how do i get the report to refresh with the new search data As for this This is gonna be one of those <V8> moments (you know, the sound of your hand hitting your forehead ...) Open the report in design view. Make the query the source (I'm guessing you have a table as a source now). Open the form in design view. "Behind" the command button, put in code to open the report. When you click the button, Access opens the report. When the report opens, it looks to the query for its data. ?<V8>? How do i stop the query from opening as well when i just want the report to open This post has been edited by Andyjones: Mar 16 2012, 06:28 PM |
|
|
|
Mar 16 2012, 06:34 PM
Post
#4
|
|
|
UtterAccess VIP Posts: 2,597 From: Parma, Idaho, US |
Just don't open the Query at all.
If the Report uses the query as its Recordsource, all you need to do is open the Report. It will find the data from the query; there's no need to run the query separately. If the criteria change, simply close the report and reopen it with the new criteria. |
|
|
|
Mar 16 2012, 07:24 PM
Post
#5
|
|
|
UtterAccess Addict Posts: 166 |
Ok John that works.
Could you check something else as well please based on the fact that langley a is in div 1 and langle b is in division 2 when i select the team in the drop down list i need the main data entry from to refer to and show the division the team is in, or do you think I would need to put a drop down box on the form for me to select the division if though when i use the add new team form I already assign the division to the team im adding. |
|
|
|
Mar 16 2012, 09:13 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 2,597 From: Parma, Idaho, US |
Well, I haven't downloaded your database so I'm not sure of the structure; but if the Division is a field in the teams table, you could include it in the combo box's Rowsource, and put a textbox on the form with a control source like
=comboboxname.Column(n) where n is the zero based index of the division field; that is, if the Division is the fourth field in the query, use Column(3). You certainly should not store the Division field redundantly; if identifying the Team reliably identifies the Division, the division should only be stored in the Teams table and just referred to in this way. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 08:14 AM |