Filling data from a list box to a text box

seanog2001

Registered User.
Local time
Today, 08:24
Joined
Jun 26, 2006
Messages
67
Ive a list box on a form which contains a persons name address and number.
when i click on a persons name i want to be able to fill their details into a coresponding text box ie

Click on john smith athlone westmeath 5555555

and it fills text boxes

firstname
lastname
address1
address2
number

I used this piece of code

Dim rs As Object

Set rs = Me.RecordsetClone
rs.FindFirst "[CandidateNo] = " & Str(Me![List8])
Me.Bookmark = rs.Bookmark
but it crashes and gives me an error
'Type mismatch'

any help?
 
You can use the Column property to refer to a specific column, in a multiple-column combo box or list box. Use 0 to refer to the first column, 1 to refer to the second column, and so on

firstname = YourListBoxName.column(0)
lastname = YourListBoxName.column(1)
address1 = YourListBoxName.column(2)
address2 = YourListBoxName.column(3)
number = YourListBoxName.column(4)
 
allan57 said:
You can use the Column property to refer to a specific column, in a multiple-column combo box or list box. Use 0 to refer to the first column, 1 to refer to the second column, and so on

firstname = YourListBoxName.column(0)
lastname = YourListBoxName.column(1)
address1 = YourListBoxName.column(2)
address2 = YourListBoxName.column(3)
number = YourListBoxName.column(4)


Cheers Man thanks for that!:D :D
 

Users who are viewing this thread

Back
Top Bottom