Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have an access form that has a listbox that shows all academic details.
when a surname is entered in the text field and the button is clicked the following code behind the button runs:
############################################
Dim sql As String
Dim WHERE As Stringsql = "SELECT * From zearchall3 WHERE [Surnames] = Forms!searchall!surname2"
List0.RowSource = sql
List0.Requery#########################################
However i need to capture the results that appear in the listbox in order to export them
DoCmd.TransferText acExportMerge, ,[what do i put here?], "c:\datafile.txt"
normally i'd put the query where the bracketed question is, but as this is not a query with a name i'm not sure how to refer to it.if the listbox was linked to a existing queryname i'd put it in there, but as the rowsourse is an sql statement how do i capture the data in the listbox?

ok i solved it.
i used this advice from this webpage
http://www.access-programmers.co.uk...
had to save the query...phew done!

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |