Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post
    If I use the filtering options on a continous form, can I then use the recordsetclone to get only those records and then save them as a table or send them to word or excel, as the basis for a mailmerge? If someone has code for this, great, otherwise I will try to create it.
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could use code like this:

    Code:
    Dim strSQL As String
    If Me.FilterOn = True Then
      strSQL = "SELECT * INTO tblNew FROM tblOld WHERE " & Me.Filter
      CurrentDb.Execute strSQL
    End If
    Here, tblNew is the name of the table to be created, and tblOld is the name of the table (or query) that acts as record source for the form.

    In the above, I assumed that the code is in the form's own module. If it's not, you must replace both occurrences of Me with a reference to the form, e.g. Forms!frmTest.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post
    Brilliant. A lot easier than reacordset clone.
    Thanks as usual

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •