Hi Guys,
I have a list box on a form with a text box.
The list box draws names using DAO from my database, and I want to click on a name in the list box and in doing so I want that records id number to appear in the text box.
Is that possible?
Thanks again In advance
les
The code im using to feed my List box is as follows:
'lists code1
Dim rs3 As Recordset
Dim db3 As Database
Set db3 = OpenDatabase("C:\Documents and Settings\webstaff\Desktop\sbtProgramme\sbt2.mdb"
Set rs3 = db3.OpenRecordset("select * FROM males " & _
"ORDER By field_kcname"
Set passmale = rs3.Fields("field_id"
Do Until rs3.EOF
staffylistmales.AddItem rs3.Fields("field_title"
& ", " & _
rs3.Fields("field_kcname"
& _
" [" & rs3.Fields("field_id"
& "]"
rs3.MoveNext
Loop
rs3.Close
Set rs3 = Nothing
' end of lists code1
I have a list box on a form with a text box.
The list box draws names using DAO from my database, and I want to click on a name in the list box and in doing so I want that records id number to appear in the text box.
Is that possible?
Thanks again In advance
les
The code im using to feed my List box is as follows:
'lists code1
Dim rs3 As Recordset
Dim db3 As Database
Set db3 = OpenDatabase("C:\Documents and Settings\webstaff\Desktop\sbtProgramme\sbt2.mdb"
Set rs3 = db3.OpenRecordset("select * FROM males " & _
"ORDER By field_kcname"
Set passmale = rs3.Fields("field_id"
Do Until rs3.EOF
staffylistmales.AddItem rs3.Fields("field_title"
rs3.Fields("field_kcname"
" [" & rs3.Fields("field_id"
rs3.MoveNext
Loop
rs3.Close
Set rs3 = Nothing
' end of lists code1