export list box to word/

M

mordy

i know how to export "regular" fields from a form, looked like acalander, to
word. i do that with bookmarks.
The main pieces of data comes from my meetings tables, and fill a lisbox in
the "calander" form, on every day.
How can i "transfer" the listbox to word, or how can i "transfer" the
listbox to a regular "text box"?

thanx

mordy
 
P

pietlinden

i know how to export "regular" fields from a form, looked like acalander,to
word. i do that with bookmarks.
The main pieces of data comes from my meetings tables, and fill a lisbox in
the "calander" form, on every day.
How can i "transfer" the listbox  to word, or how can i "transfer" the
listbox  to a regular "text box"?

thanx

mordy

Option Compare Database
Option Explicit

Private Sub cmdPopulate_Click()
Dim rs As DAO.Recordset
Set rs = DBEngine(0)(0).OpenRecordset("Table1", dbOpenTable)

Do Until rs.EOF
Me.List0.AddItem rs.Fields(0)
rs.MoveNext
Loop

rs.Close
Set rs = Nothing
Me.List0.Requery
End Sub

Private Sub cmdWriteToTextbox_Click()
Dim varItem As Variant
Dim strList As String

For Each varItem In Me.List0.ItemsSelected
strList = strList & ", " & Me.List0.ItemData(varItem)
Next varItem

strList = Right$(strList, Len(strList) - 2)
Me.Text2 = strList
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top