Create table from Filtered records on a form

G

Guest

Hi all

I know I can have a filtered query create a new table but can I do it from
records filtered on the current form which are selected by a user? The user
chooses a Year (YearFilter) and a Quarter period (toggle button values 1 - 4)
which filters data and I want to create a new table of this set of records.

Thanks in advance for any help.
Sue
 
B

B_A_R_T_M_A_N

Sue, here is an example of how to use the current forms filter. You
would need to change the sql to a createtable, then probably an append
or insert, but it shows how to use the current forms filter as part of
a query.


Dim theFilter As String

DoCmd.SetWarnings False

If Me.FilterOn = True Then
theFilter = " AND " & Me.Filter
Else
theFilter = ""
End If


DoCmd.RunSQL "UPDATE qryAddressBids_Assign_Sub2ndTry SET
qryAddressBids_Assign_Sub2ndTry.Assign = true " & _
"WHERE
(((qryAddressBids_Assign_Sub2ndTry.Assign)=False))" & theFilter & ";"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top