Connecting Tech Pros Worldwide Help | Site Map

ACCESS 97 Recordsets

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 04:04 AM
Paul
Guest
 
Posts: n/a
Default ACCESS 97 Recordsets

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, 04:05 AM
Salad
Guest
 
Posts: n/a
Default 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




 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.