You want the user to use the same query you are already outputting? If so, on the On Click button to run your function, do this:
Dim sGroup, sLink, sDoc As String
sGroup = Me.GroupFieldName
sLink = "[GroupFieldName] = '" & sGroup & "'"
sDoc = "qryYourQueryName"
DoCmd.OpenQuery sDoc, , sLink
DoCmd.TransferSpreadsheet etc.
DoCmd.Close acQuery, sDoc
Something like that.
Does that help?
mmcdonal
|