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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a new table

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
I have a table called "PAYROLL DATA". It has the following fields: NAME, ID, WKHRS, OT, REMARKS.

Using code, I want to extract all the records in the table which contain the word "FAILED" in the remarks field and create a new table of the "FAILED" records.

Can anyone help. Thanks in advance.

Richard...
 
use a make table query. In the criteria for the Remarks field enter "Failed". If the field may contain Failed embedded within ie. 'it has failed' etc. try:
like "*failed*" for the criteria.

Hope this works and makes sense,

Nick
 
Thanks for the response, Nick.

But, I wanted to do it using code. Do you know how?

Thanks.

Richard...
 
Create the query first. Goto the sql window and copy the code.
If you want the code behind a button, create the form and add the button. Goto the buttons' onclick event and do the following:

dim db as database
dim sMakeTable as string

set db = currentdb
sMakeTable = ''paste your query here

db.execute(sMakeTable)

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top