Computing.Net > Forums > Database > how to capture listbox data?

how to capture listbox data?

Reply to Message Icon

Original Message
Name: chaft
Date: June 8, 2008 at 16:04:32 Pacific
Subject: how to capture listbox data?
OS: xp
CPU/Ram: 2gb
Model/Manufacturer: custom
Comment:

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 String

sql = "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?



Report Offensive Message For Removal


Response Number 1
Name: chaft
Date: June 8, 2008 at 16:20:10 Pacific
Subject: how to capture listbox data?
Reply: (edit)

ok i solved it.

i used this advice from this webpage

http://www.access-programmers.co.uk...

had to save the query...phew done!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: how to capture listbox data?

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge