Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i make a basic macro to query a table in Access 2000 2

Status
Not open for further replies.

ddunstone

MIS
Feb 15, 2000
2
AU
I want to query a table with a word, to see if it matches any full or partial fields within the whole table...<br>
How is this done?
 
Ok<br>
click the Querys TAB<br>
then click the New button to make a query.<br>
Pick the top option &quot;Design view&quot;<br>
Then pick the table you want to look up your data in.<br>
Click Add then click Close<br>
Now drag the fields you want to see to the grid below.<br>
Now, Say you want to find all the &quot;Smiths&quot; in the &quot;Last name&quot; field <br>
click in the Field in question and put [Enter Last Name]<br>
exactly like that brackets and all in the &quot;Criteria&quot; box.<br>
If you want to sort the results by any field click Sort field and pick Ascending or Descending. <br>
click the RED exclamtion mark (At the top in the menu buttons) and up will pop a box type in your &quot;WORD&quot; <br>
It will find matches base on that<br>
Experiment with differnet &quot;WORD&quot;s and see the results<br>
Look at the results and see the number of records it returns. 1 of 222<br>
This will tell you where you are at<br>
Run then query with NO &quot;words&quot; and it should return all records in the table say 989 then run your query and see the resulting number get less.<br>
<br>
OK if you want to find say Smith and Smurfs togerther then put this in the box<br>
Like [Enter Name] & &quot;*&quot;<br>
It will find everything that &quot;Starts&quot; with the letter you type like Sm will find Smith and Smurfs and Smileys etc.<br>
<br>
Enjoy Access <br>
She'll give you ALL the Power you need 'Scotty' <p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Now to open your query with a macro<br>
click Macros Tab and new<br>
then click in the top blank cell and <br>
Press &quot;R&quot; on your keyboard and it will jump to the &quot;R&quot;s then find &quot;OpenQuery&quot; Now in the bottom of the macro screen <br>
click in the White box next to &quot;Query Name&quot; and find your query.<br>
Save it and give it a name such as &quot;OpenQuery&quot;<br>
Now if you don't put any spaces in your macro name you can create a Icon on your desktop that will open Access and your data base and run this macro.<br>
<br>
Heres an example of one on my Desktop<br>
&quot;C:\Microsoft Office97\Office\MSACCESS.EXE&quot; Y:\MachinesInStock.mdb /X Machines<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
BTW, you don't need to build anything. You can use the &quot;Find&quot; feature (on the toolbar) to search an entire table or part of it for a word or part of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top