search query from a button in a form

I have created a button in a form that will be used to search from a table.  
I have three different queries made to search from that table.  When I push 
the button to run the macro which in turn runs the 3 individual queries, it 
just creates the results in 3 individual windows.  I would like it to save 
the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/22/2007 6:34:01 PM
access.forms 6864 articles. 2 followers. Follow

6 Replies
573 Views

Similar Articles

[PageSpeed] 44

Has to be one query to get one result.
-- 
Dave Hargis, Microsoft Access MVP


"wspintern" wrote:

> I have created a button in a form that will be used to search from a table.  
> I have three different queries made to search from that table.  When I push 
> the button to run the macro which in turn runs the 3 individual queries, it 
> just creates the results in 3 individual windows.  I would like it to save 
> the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/22/2007 8:20:02 PM
Ok that makes sense.  THen is there anyway to combine the queries so that I 
can get only one result?

"Klatuu" wrote:

> Has to be one query to get one result.
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "wspintern" wrote:
> 
> > I have created a button in a form that will be used to search from a table.  
> > I have three different queries made to search from that table.  When I push 
> > the button to run the macro which in turn runs the 3 individual queries, it 
> > just creates the results in 3 individual windows.  I would like it to save 
> > the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/22/2007 9:08:01 PM
If it is just one table, you should be able to just write one query with all 
the criteria combined from the 3.  Maybe if you post the SQL from the 
queries, we can have a look.

If you are not sure how to do that, just open  a query in design mode, 
switch to SQL view and copy/paste it.

Send all 3
-- 
Dave Hargis, Microsoft Access MVP


"wspintern" wrote:

> Ok that makes sense.  THen is there anyway to combine the queries so that I 
> can get only one result?
> 
> "Klatuu" wrote:
> 
> > Has to be one query to get one result.
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "wspintern" wrote:
> > 
> > > I have created a button in a form that will be used to search from a table.  
> > > I have three different queries made to search from that table.  When I push 
> > > the button to run the macro which in turn runs the 3 individual queries, it 
> > > just creates the results in 3 individual windows.  I would like it to save 
> > > the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/22/2007 9:12:02 PM
Here is the SQL data for the query:
SELECT tbl_Standards.[Standard_ #], tbl_Standards.Chemical_name, 
tbl_Standards.[Keyword 1], tbl_Standards.[Keyword 2], tbl_Standards.[Keyword 
3]
FROM tbl_Standards
WHERE (((tbl_Standards.[Keyword 1])=[Enter keyword])) OR 
(((tbl_Standards.[Keyword 2])=[Enter keyword])) OR (((tbl_Standards.[Keyword 
3])=[Enter keyword]));

Note: the SQL data for the other two queries is identical...I want to be 
able to search the same table that contains three columns with keywords in 
each (some columns may contain the same words but for different items) and I 
wanted to have the opportunity to search for three different words if I so 
chose to, or just one, or two.  Does this make sense?
Thank you for your help!

"Klatuu" wrote:

> If it is just one table, you should be able to just write one query with all 
> the criteria combined from the 3.  Maybe if you post the SQL from the 
> queries, we can have a look.
> 
> If you are not sure how to do that, just open  a query in design mode, 
> switch to SQL view and copy/paste it.
> 
> Send all 3
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "wspintern" wrote:
> 
> > Ok that makes sense.  THen is there anyway to combine the queries so that I 
> > can get only one result?
> > 
> > "Klatuu" wrote:
> > 
> > > Has to be one query to get one result.
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "wspintern" wrote:
> > > 
> > > > I have created a button in a form that will be used to search from a table.  
> > > > I have three different queries made to search from that table.  When I push 
> > > > the button to run the macro which in turn runs the 3 individual queries, it 
> > > > just creates the results in 3 individual windows.  I would like it to save 
> > > > the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/22/2007 11:16:01 PM
If what you are saying is you want to be able to search for multiple values 
in Keyword 1 and multiple values in Keyword 2, and also Keyword 3.  you can 
style it this way.  The only downside is whomever has to do the entry, has to 
know how to do it correctly.  You can us the IN predicate:

WHERE (((tbl_Standards.[Keyword 1]) IN([Enter keyword]))) OR 
(((tbl_Standards.[Keyword 2]) IN([Enter keyword]))) OR 
(((tbl_Standards.[Keyword 
3])IN([Enter keyword])));

To enter it correctly, the values must be separated by commas.  text values 
need to be enclosed in quotes:

"Fred", "Joe", "Alvin", "Dan"

Dates in #

#8/23/2007#, #9/13/2007#, #5/25/2007#

Numbers need no delimiter

8,15, 202, 64
-- 
Dave Hargis, Microsoft Access MVP


"wspintern" wrote:

> Here is the SQL data for the query:
> SELECT tbl_Standards.[Standard_ #], tbl_Standards.Chemical_name, 
> tbl_Standards.[Keyword 1], tbl_Standards.[Keyword 2], tbl_Standards.[Keyword 
> 3]
> FROM tbl_Standards
> WHERE (((tbl_Standards.[Keyword 1])=[Enter keyword])) OR 
> (((tbl_Standards.[Keyword 2])=[Enter keyword])) OR (((tbl_Standards.[Keyword 
> 3])=[Enter keyword]));
> 
> Note: the SQL data for the other two queries is identical...I want to be 
> able to search the same table that contains three columns with keywords in 
> each (some columns may contain the same words but for different items) and I 
> wanted to have the opportunity to search for three different words if I so 
> chose to, or just one, or two.  Does this make sense?
> Thank you for your help!
> 
> "Klatuu" wrote:
> 
> > If it is just one table, you should be able to just write one query with all 
> > the criteria combined from the 3.  Maybe if you post the SQL from the 
> > queries, we can have a look.
> > 
> > If you are not sure how to do that, just open  a query in design mode, 
> > switch to SQL view and copy/paste it.
> > 
> > Send all 3
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "wspintern" wrote:
> > 
> > > Ok that makes sense.  THen is there anyway to combine the queries so that I 
> > > can get only one result?
> > > 
> > > "Klatuu" wrote:
> > > 
> > > > Has to be one query to get one result.
> > > > -- 
> > > > Dave Hargis, Microsoft Access MVP
> > > > 
> > > > 
> > > > "wspintern" wrote:
> > > > 
> > > > > I have created a button in a form that will be used to search from a table.  
> > > > > I have three different queries made to search from that table.  When I push 
> > > > > the button to run the macro which in turn runs the 3 individual queries, it 
> > > > > just creates the results in 3 individual windows.  I would like it to save 
> > > > > the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/23/2007 2:16:05 PM
That is pretty close...essentially I want to be able to search for a text 
word say "opiate" that may appear in Keyword 1, Keyword 2, and/or Keyword 3 
column and I want to view all of the results which I have been able to do.  
However, the problem lies that I want to be able to have the ability to 
search for a second and third word say "sedative" and "hallucinogen" which 
also appears in Keyword 1, Keyword 2, and/or Keyword 3 columns and have all 
of the results appear on one table.  With the SQL data you provided I am able 
to search for one word and get results however when I search for two or three 
words for some reason, whatever "text" I type into the search box whether or 
not its even a word contained in the columns it just enters that word in 
EVERY blank for that column in the results (for example if I type the word 
"opiate" which isnt in the keyword 3 column it replaces everything in that 
column with the word opiate).  So I am just not really sure what to do and if 
what I want to acheive is possible??  
Thanks for your help in all of this frustration!

"Klatuu" wrote:

> If what you are saying is you want to be able to search for multiple values 
> in Keyword 1 and multiple values in Keyword 2, and also Keyword 3.  you can 
> style it this way.  The only downside is whomever has to do the entry, has to 
> know how to do it correctly.  You can us the IN predicate:
> 
> WHERE (((tbl_Standards.[Keyword 1]) IN([Enter keyword]))) OR 
> (((tbl_Standards.[Keyword 2]) IN([Enter keyword]))) OR 
> (((tbl_Standards.[Keyword 
> 3])IN([Enter keyword])));
> 
> To enter it correctly, the values must be separated by commas.  text values 
> need to be enclosed in quotes:
> 
> "Fred", "Joe", "Alvin", "Dan"
> 
> Dates in #
> 
> #8/23/2007#, #9/13/2007#, #5/25/2007#
> 
> Numbers need no delimiter
> 
> 8,15, 202, 64
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "wspintern" wrote:
> 
> > Here is the SQL data for the query:
> > SELECT tbl_Standards.[Standard_ #], tbl_Standards.Chemical_name, 
> > tbl_Standards.[Keyword 1], tbl_Standards.[Keyword 2], tbl_Standards.[Keyword 
> > 3]
> > FROM tbl_Standards
> > WHERE (((tbl_Standards.[Keyword 1])=[Enter keyword])) OR 
> > (((tbl_Standards.[Keyword 2])=[Enter keyword])) OR (((tbl_Standards.[Keyword 
> > 3])=[Enter keyword]));
> > 
> > Note: the SQL data for the other two queries is identical...I want to be 
> > able to search the same table that contains three columns with keywords in 
> > each (some columns may contain the same words but for different items) and I 
> > wanted to have the opportunity to search for three different words if I so 
> > chose to, or just one, or two.  Does this make sense?
> > Thank you for your help!
> > 
> > "Klatuu" wrote:
> > 
> > > If it is just one table, you should be able to just write one query with all 
> > > the criteria combined from the 3.  Maybe if you post the SQL from the 
> > > queries, we can have a look.
> > > 
> > > If you are not sure how to do that, just open  a query in design mode, 
> > > switch to SQL view and copy/paste it.
> > > 
> > > Send all 3
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "wspintern" wrote:
> > > 
> > > > Ok that makes sense.  THen is there anyway to combine the queries so that I 
> > > > can get only one result?
> > > > 
> > > > "Klatuu" wrote:
> > > > 
> > > > > Has to be one query to get one result.
> > > > > -- 
> > > > > Dave Hargis, Microsoft Access MVP
> > > > > 
> > > > > 
> > > > > "wspintern" wrote:
> > > > > 
> > > > > > I have created a button in a form that will be used to search from a table.  
> > > > > > I have three different queries made to search from that table.  When I push 
> > > > > > the button to run the macro which in turn runs the 3 individual queries, it 
> > > > > > just creates the results in 3 individual windows.  I would like it to save 
> > > > > > the results all in one window, how can I do this?   Thanks much in advance!
0
Utf
8/23/2007 4:44:04 PM
Reply:

Similar Artilces:

California DE-6 Tax Form
During a demo I was asked if a DE-6 tax form can be printed out of GP Payroll. Not being from California I was not sure. I did not see the report in Payroll. Solutions would be appreciated. thanks I don't believe that GP has the DE-6 in it but there is a 3rd Party product developed by Aatrix Software that does the state unemployment reports for all 50 states (which includes the CA DE-6). These reports pull the data out of your Great Plains database. You can check out a free demo on their web site. www.aatrix.com, click on payroll reports and select the quarterly download for M...

toolbar enable, including is customize buttons
I am testing Microsoft Office 2007 to which I downloaded on 9/17 for 30 days trial to see if our company will upgrade from 2003 to 2007 version. I was working fine for the past week however, Friday and today, I am unable to access the toolbar buttons such as (outlook-reply, forward) (word-mail-envelope). I already attempted going to tools and customize which also is not lit. In addition, I shut down and rebooted. Please fix/and explain what we do from here. Thank You ...

POP Blank PO Form #2
Is there a way to limit the number of lines that are printed on a page? Want to limit 10 and then go to new page. -- Christopher Sorel ...

Recipient Policy and LDAP Query Help Needed
Hi everyone, We are using Exchange 2003, now with Recipient Policies i'm trying to get both groups and users with the same attribute and am trying the following: (&(objectCategory=group)(objectCategory=user)(extensionAttribute1=ozpacific)(extensionAttribute1=ozpacific)) But it returns nothing, if I try to query JUST users, it returns results like it should and the same with groups, but as soon as I try to put them both in 1 query, like above, it returns nothing... what am doing wrong there? Thanks in advance, Matthew "OzPacific" <matthew@ozpacific.net.au> wrote: ...

Simple Query only returning 5 records
I am very new to Access, therefore I'm pretty sure I know where the problem is. That said...I have a query built of multiple imported tables. I'm mostly using it to combine values for data analysis. I have been changing the query up and rerunning it over and over. Yesterday I got some error that said I didn't have enough memory or disk space to finish the query. Now I can only get 5 records out when I run the query. I don't know if the two are related but something is up. In trying to discover the issue I have deleted all table connections and simply tried to return all the val...

Search last 4 digits in an (account number)
I store bank accunt and credit card numbers in various Contact Notes. For example, a credit card # as xxxxxxxxxxxx1234. Outlook contact search would not find this contact if I enter the search for "1234". Is there a way to do this in Outlook 2007? TIA PS - this search works fine in Outlook Mobile. outlook searches from the beginning - so it will only work if you use xxxxxxxxxxxx 1234. Other search tools (like google desktop) may find it. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: htt...

MFC Toolbar Button Size Corruption
Hi, I've just run into a problem porting an MFC application from VC++ 2003 to VC++2005. The application contains a toolbar. The toolbar has the extended style TBSTYLE_EX_DRAWDDARROWS One of the toolbar buttons has the style TBSTYLE_DROPDOWN. The toolbar is contained within a ReBar When a WM_SETTINGCHANGE message is received by the toolbar it seems to increase the size of all the buttons in the toolbar, causing parts of all button images to fall off the bottom and right edges of the toolbar. I've bugged this on connect.microsoft.com, ID229061. There is a code sample in the b...

Look for: Search In => Choose folders=> Search subfolders not working
When I search for an old email using Outlook's Look for: box and specify which folders to search in via the "Choose folders=>Search subfolders" checking a folder does not actually cause any subfolders to be checked. Unless there is some other setting and/or option hidden away somewhere, the "Search subfolders" check box is not working. I must manually check all the desired subfolders. What am I doing wrong? -- Regards, Peter Sale Santa Monica, CA USA To email me, just pull 'my-leg.' ...

Sub Form
How I will make many Sub Forms in Tabualr mode in one main form -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200708/1 suggest you don't open "many" subforms. there's a lot of overhead when you open multiple subforms in a single main form. since you're using a tab control, your users will only be able to see one subform at a time anyway; so you can use *one* subform control, put it on the main form "behind" the subform and it will show up on all the tabs. then use some code to load the appropriate sou...

Complex xPath Query #2
I am trying to build a xPath Query to use on SelectNodes function in VB.net The data I want to search is by MemberCity = O'Fallon My xPath Query is xPathQuery = "Matched[@MemberCity='O'Fallon']" The problem is the apostrophe in the city name that is failing. How do I build the xPathQuery so that it can take into account the apostrophe Any idea(s) thanks --- Posted using Wimdows.net NntpNews Component - Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching. ...

Com Addin Button
Hi, I managed to add a Com addin button in outlook using vb6 which displays a message box when clicked. But when i open a message the button is not visible. Can anybody uide me as to what i am doing wrong. I need the button to be visible at all times. Thanks a lot in advance. When creating custom forms in Outlook, there are two views: one for the Compose Page (what the sender sees), and one for the Read Page (what the recipient sees). Sounds like your button resides only on the Compose Page. If that's the case, simply copy the control to the Read Page. > I managed to add a Com ...

Searching for Newsgroups
I subscribe to a Usenet service for accessing various news groups. After I download all the newsgroups from that server I can not find a way to search for the newsgroups I have interest in. When I put something like "RV" in the search box on the top right corner, it searches all of my Emails rather than just the list of groups that had "RV" in the title. Help tells me that there is a " Display newsgroups containing" box but for the life of me I can't find it. Any thoughts out there? I am running Entourage 12.2.3 Dunc Click the bar in th...

How do I save a narrated (sound embedded) PPT07 file in SCORM form
I want to allow my company's LMS (Learning Management System) to store, push, and report viewership of narrated (Isound embedded) PPT 2007 files. The LMS has two APIs for content: SCORM 1.2 or AICC. Has anyone found a way to store narrated PPTs (or take intermediate steps) to create SCORM-format output so an LMS can manipulate it? ...

Search & replace in formulae
Is it possible to do a search and replace which includes the cell formula contents ? I have a workbook that has cells which link to the contents of a cell in another workbook and I'd like to know if the naming has to remain constant or if I can replace a part of the name periodically. ie each year. thanks "Iain Rhodes" <iain@pricejam.com> wrote in message news:8ec201c49682$858c5d20$a501280a@phx.gbl... > Is it possible to do a search and replace which includes > the cell formula contents ? I have a workbook that has > cells which link to the contents of a cel...

deleting a form
How do you delete a form from the organizational forms lib? Use Outlook, and go to Tools / Options / Other / Advanced Options / Custom Forms / Manage Forms -- Neil Hobson Exchange MVP For Exchange news, links and tips, check: http://www.msexchange.co.uk "scavngr" <aaa@winn-dixie.com> wrote in message news:020b01c3c9a2$e7485cb0$a501280a@phx.gbl... > How do you delete a form from the organizational forms lib? ...

Union All Query bombs report
I have a union query that joins tables that have memo fields. I saw help in the Discussion Group that suggested using Union All to get all the characters in the query. It works fine for the query (I see all the characters in the memo field in the datasheet), but it bombs the report. MS Access closes, offering to repair and restart. Repairing and restarting does not work. The report worked fine (aside from not having all the characters in the field) when the query was Union instead of Union All (and it works now if I change it back to just Union). Any suggestions? On further search...

Search engine optimization
Hello all! My question today regarding this issue is: I have noticed some sites have the following on their sites "Source". meta name= "robots" content="Index, follow" meta name= "revisit-after" content="15 days" or (30 days) What does this function accomplish as far as search engines go? and will it really imporve your results ( rankings) Like for instance "robots" "index, all" what is the difference between this and saying "robots" "index, follow" I'm a bit confused about this. Can someone ...

Can I search identical fields from multiple tables?
I have a database to log details about staff in my school. I have a tables for staff details, courses, absence, educational visits etc. In each table I have a date field to show when the member of staff is not present. I want to produce a query to search all tables by entering a date - e.g. to bring back all results for staff who are not in school on a certiain day because they are either ill, on a course or on an educational visit. The query will work by entering a date once - it will then search all the other tables and bring back the results. Is this possible? Do I restructure? ...

What does outlook search when you search Contacts ?
When you do a search in oulook for contacts, what is the criteria that outlook searches? Or I guess how does outlook search? Why is it not consistant? The reason I am asking is that we have our customers contacts in public folders. In our customers we have 6 contacts for XYZ Foods. If you search in outlook for just "XYZ" it only comes back with 4 of the six. If you do a search for "XYZ Foods" it returns with all 6. And if you just entered "Foods" no contacts were found. And we actually have a few companies in our contacts who's names are a two part name ending...

retrieving maximum value from query
hi there, I have a table of the following schema build --------------------------- build_id AutoNumber build_date Date/Time label Text CL Number ---------------------------- for a simple query like SELECT build.CL FROM build; how can I apply a filter so that I only get the max CL value? thanks in advanced. SELECT Max(CL) FROM build If you want the details about the entry with the largest value, you could try: SELECT build_id, build_date, label, CL FROM build WHERE CL IN (Select Max(CL) FROM build) Recognize, of course, th...

excel VBA
How would i search a range of a whole column instead of specific cells like .Range("a1:a300")? --- Message posted from http://www.ExcelForum.com/ ..range("a:a") ..columns(1) ..range("a1").entirecolumn are a few ways. "Zygoid <" wrote: > > How would i search a range of a whole column instead of specific cells > like .Range("a1:a300")? > > --- > Message posted from http://www.ExcelForum.com/ -- Dave Peterson ec35720@msn.com ahhh! Thanks!! I was trying .Column(1) i see i neede an "s" in there Thanks a...

Command Button To Delete Text In Single Field In Record
Hello All, I want to be able to do is open a particular form, which based on a table. "Enquirys" form is called "Enquiry_Date_Reset" On the form i want to scroll to a particular record and then press a button which will clear the date which is stored in the [Date Sent] field for that particular record set. (Not the whole record) is this possible? Regards Dan On Fri, 03 Aug 2007 09:08:56 -0700, dan.cawthorne@gmail.com wrote: > Hello All, > > I want to be able to do is open a particular form, which based on a > table. "Enquirys" > > form ...

Multiple fields using to search
Hi, Something i've been batteling for weeks with and theres probably such a simple answer to it and i just cant see it: Riiiight, i have this form (lets call it frmClientSearch) On this form i have a 2 list box thinghys; One called lstEmployee which is populated with Employee names and the other lstCity which is populated with City Names. Then i have a command button (cmdSearch) which, once click and values selected in both the lst boxes, should return only the values that are equal to both the lst boxes in a new form called frmSearchResult. (Hope i make sense) So... I know how ...

write a query to retrieve data
I have three sheets in my workbook: Request sheet with request number and date,Fault sheet with request number and faults count,and in the third sheet I have month start date and end date. I want to retrieve data such that : sum of all the faults of those requests which fall in the month given in third sheet Request Sheet Request ID ActualEnd Date 1 1/22/2006 2 2/27/2006 3 1/22/2006 4 1/22/2006 5 1/22/2006 Fault Sheet Request ID Total 1 6.75 2 3.75 3 7.50 third sheet Jan-06 1/1/2006 1/31/2006 to get value Hi, There may be a better way of organizing yo...

Search, Search, Thanks
In the last couple of weeks I have been fighting with different ways o synching my laptop and my home pc. I have ended up with numerou duplicate entries, duplicate address books and duplicate contact lists ALL of my questions/problems I was able to resolve simply by searchin through the forums. Chances are if you have a problem you're not th first. There are some really good people on these forums that know alo more about Outlook than I do. Just my .02 Thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages dir...