Getting an error when trying to export a file

On a form I have a command button that when clicked is supposed to do this:

    MsgBox "This function will export the birthday list to your desktop."

    Dim strCSV As String

    DoCmd.TransferText acExportDelim, , "qryBirthdayList", strCSV & Environ("userProfile") & "\Desktop\" & "Birthday List " & Format(Now, "mm-dd-yyyy_hh-nn") & ".csv"

    MsgBox "File has been exported.  Please check your desktop."

Open in new window

The query (SQL) looks like:
SELECT [mail list].[LAST NAME], [mail list].[FIRST NAME], [mail list].DateOfBirth
FROM [mail list]
WHERE ((([mail list].DateOfBirth) Between [Forms]![frmBirthdayList]![txtStartDate] And [Forms]![frmBirthdayList]![txtEndDate]))
ORDER BY [mail list].[LAST NAME];

Open in new window

When I run the query it works fine.  But when I try to export I get this error:

"Cannot reference a table with a multi-valued field using an IN clause that refers to another database."

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sounds like you will have to remove the multi-valued field from the export.  To confirm, remove the multi-valued field from the query and then export.  If that solved the problem, you have your answer.
Gustav BrockCIOCommented:
Or try to change your current query to a create-table-query.
Then export the created table.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveL13Author Commented:
Tried removing it.  Still didn't work.  

So did the make table method and it worked.
Gustav BrockCIOCommented:

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.