select record on subform and return with a value

xhoz

New member
Local time
Today, 08:41
Joined
Sep 13, 2004
Messages
8
Hey

i have a form with a listbox on it and a subform
when i select something in my listbox on the form, the subform shows the filtered records....

But i filter on areacode(listbox)...and i have for example 30 records with customers(id, names, streetname, phonenumber, ...)
When i click on a record in my subform...How can i get by clicking on a button or, ... the value of the customer-(id,name, street,...) out of that selected record(with my mouse) ?

can someone give me some information, or vba-code or write it in a small database?

(sorry for my english but i'm dutch :rolleyes: )

greetz Xhoz
 
To select the column (hidden or displayed) value in a list box:

private sub AButton_Click
dim irow as integer
dim ctl as control
set ctl=me!listboxName
for irow = 0 to ctl.listcount-1
if ctl.selected(irow) = true then
'ctl.column(ij,irow) gives you column ij (0 to n) in the selected row
'do something with it
end if
next
end sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom