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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to capture listbox data?

Reply to Message Icon

Name: chaft
Date: June 8, 2008 at 16:04:32 Pacific
OS: xp
CPU/Ram: 2gb
Product: 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?




Sponsored Link
Ads by Google

Response Number 1
Name: chaft
Date: June 8, 2008 at 16:20:10 Pacific
Reply:

ok i solved it.

i used this advice from this webpage

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

had to save the query...phew done!


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: how to capture listbox data?

SQL+ how to spool with data padding www.computing.net/answers/dbase/sql-how-to-spool-with-data-padding/191.html

How to allocate the data equally to members www.computing.net/answers/dbase/how-to-allocate-the-data-equally-to-members/642.html

pass data from server to my own pc www.computing.net/answers/dbase/pass-data-from-server-to-my-own-pc/325.html