List box Click through

Jaydub1991

New member
Local time
Today, 14:05
Joined
Sep 21, 2021
Messages
10
Would anyone be able to help me with code for a list box click through code for VBA

I have a search form which i have set up which pulls data from a table but I also have a form set up which displays each individual data row.

I would like to be able to search in my form, click the result and get taken to the correct form field

So I have tried to look for others that have done this but im not good at VBA so may need bottle feeding on this!

so far i have seen stuff like
'listbox.selecteditem.tostring'

but i havent got a clue how to make it go to the correct record on the form
 
Do want to click the item in the list, then show that record (filter)

Code:
sub lstBox_Afterupate()
if IsNull(lstBox) then
   me.filterOn = false
else
  me.filter = "[ID]=" & lstBox
  me.filterOn = true
endif
lstBox.requery
end sub
 
Would anyone be able to help me with code for a list box click through code for VBA

I have a search form which i have set up which pulls data from a table but I also have a form set up which displays each individual data row.

I would like to be able to search in my form, click the result and get taken to the correct form field

So I have tried to look for others that have done this but im not good at VBA so may need bottle feeding on this!

so far i have seen stuff like
'listbox.selecteditem.tostring'

but i havent got a clue how to make it go to the correct record on the form
Can't you just use a 'Combo Box' wizard? Much easier and no VBA required.
 

Users who are viewing this thread

Back
Top Bottom