Connecting Tech Pros Worldwide Help | Site Map

ACCESS 97 Recordsets

  #1  
Old November 13th, 2005, 05:04 AM
Paul
Guest
 
Posts: n/a
I could really use some help please.

SETUP:
I have a table called "ProductTable"
I have a query called "ProductQuery" based on ProductTable
I have a form Called "ProductMF" based on ProductQuery
I have another table called TempProductTable (same as ProductTable, but
without the primary key..."ProductID")

SITUATION:
I want the user to be able to filter the ProductMF...anyway they want, then
I want a piece of code on a button to copy the filtered records from the
form into the TempProductTable.

SO FAR:
I started to do this using a recordsetclone for the form and a recordset for
the temp table. Then I realized that I would have to do this for each and
every textbox, combobox, checkbox, etc. control on the from and save it to
the appropriate field in the TempProductTable.

I was wondering if there was an easier way to save the filtered recordset of
the form into the TempProductTable?...something like an export possibly.

Thanks in advance.

Paul


  #2  
Old November 13th, 2005, 05:05 AM
Salad
Guest
 
Posts: n/a

re: ACCESS 97 Recordsets


Paul wrote:
[color=blue]
> I could really use some help please.
>
> SETUP:
> I have a table called "ProductTable"
> I have a query called "ProductQuery" based on ProductTable
> I have a form Called "ProductMF" based on ProductQuery
> I have another table called TempProductTable (same as ProductTable, but
> without the primary key..."ProductID")
>
> SITUATION:
> I want the user to be able to filter the ProductMF...anyway they want, then
> I want a piece of code on a button to copy the filtered records from the
> form into the TempProductTable.
>
> SO FAR:
> I started to do this using a recordsetclone for the form and a recordset for
> the temp table. Then I realized that I would have to do this for each and
> every textbox, combobox, checkbox, etc. control on the from and save it to
> the appropriate field in the TempProductTable.
>
> I was wondering if there was an easier way to save the filtered recordset of
> the form into the TempProductTable?...something like an export possibly.
>
> Thanks in advance.
>
> Paul
>[/color]

You could create an append query that appends the records to the temp
table. This query would have no filter.

Now, open up the query in SQLView. Copy and paste it into your code for
the button and assign it to a variable. Ex:

strSQL = "INSERT INTO Temp SELECT Table1.* FROM Table1 "

(the above won't work since Table1 has a key field which in your case
does not exist in Temp so you need to specifiy the fields to
append....or create a query called ProductQueryWithoutID if you have a
real long field list.)

strSQL = "INSERT INTO Temp SELECT ProductQueryWithoutID.* FROM
ProductQueryWithoutID "

Then you can do something like

strSQL = strSQL & " Where " & Me.Filter
Currentdb.Execute strSQL




Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Not Found, Access 97/2000 Conversion Cy answers 12 January 28th, 2006 10:15 PM
MS Access reports containing line charts are inaccurate after upgrade from access 97 to 2000 NickJ answers 3 November 13th, 2005 01:16 PM
dao reference confusion: access 97 to 2003 JMCN answers 4 November 13th, 2005 02:48 AM
Access 2002 vs Access 97 Performance Rob answers 9 November 13th, 2005 12:04 AM