cascading listboxes

cascading listboxes

Post by aXJpc » Mon, 19 Oct 2009 17:06:01


I have a userform in word with 1 listbox and 3 textboxes.

the database is an access database with 7 columns.

I am initializing the listbox with 7 columnbound columns.

this is my code:

Private Sub UserForm_Initialize()
On Error Resume Next

Dim dbDatabase As Database
Dim rsd As Recordset
Dim d As Integer
Set dbDatabase = OpenDatabase("C:\nihul.mdb")
Set rsd = dbDatabase.OpenRecordset("SELECT * FROM expressions ORDER BY
heb;", dbOpenSnapshot)

ListBox1.Clear
d = 0
With rsd
Do Until .EOF
ListBox1.AddItem (d)
ListBox1.ColumnCount = 3
ListBox1.BoundColumn = 7
ListBox1.ColumnWidths = "4 in;4 in;0.5 in;"
ListBox1.Column(6, d) = ![hebrt]
ListBox1.Column(0, d) = ![heb]
ListBox1.Column(1, d) = ![eng]
ListBox1.Column(2, d) = ![engRT]
.MoveNext
d = d + 1
Loop
End With

rsd.Close
dbDatabase.Close
Set rsd = Nothing
Set dbDatabase = Nothing
End Sub

after initializing the list box, I want to click on an item in the listbox
and see the coloumnbound data from the database in the 3 textboxes (each
column in an other textbox).

Thank you in advance for your help!

Iris
 
 
 

1. Air Code Mr. Goldgar Cascade Listbox to highlite, select closest

2. Cascading Listboxes on Intranet

Hi, I would like to set up 4 cascading listboxes with each dependent on the
previous listbox selection. I understand that means round trips to the sever
if purely asp (no java script as this is a pure asp enviroment) but I am at a
loss on how to start or in which direction to go. Could someone please outline
the method to use ... I am familiar with DW, recordsets etc ... just a little
out of my depth when dealing with what events to harness on the list boxes to
force submission of the selection form. Oh yes, under the selection form I
would like to show the results on the same page in another form (table with
repeat region) after the 4th list box has been selected/submitted. Thanks
very much. Regards. Dave(UK)

3. Cascading ListBoxes??

4. Cascading Listboxes feeding off each other

5. Cascading listbox entries on a repeating section

6. Air Code Mr. Goldgar Cascade Listbox to highlite, select clos

7. Cascading Listbox

8. Cascading ComboBoxes or Listboxes

9. cascading multiselect listboxes

10. Cascading Combo and Listbox errors

11. listbox.value not equal to listbox.list(listbox.listindex,0)

12. Moving listbox item from listbox to listbox

13. How to tell if a Foreign Key uses cascade delete or cascade update?

14. CASCADE: I hate cascades Greggie, So Obssesed He's Running Google Searches On My Nyme

15. CASCADE: I hate cascades Greggie, So Obsessed He's Runnning Google Serches On My Nye