Display selected item in list box

grenee

Registered User.
Local time
Yesterday, 22:24
Joined
Mar 5, 2012
Messages
212
Good Day all.

I am trying to use a macro to popup a message box with the name of the item selected in a listbox. I do not want to use VBA code

This is what I tried:
Code:
Temp = List2.ListIndex
 

MsgBox      Me.List2.Column(1, Me.List2.ListIndex)

Can anyone assist
 
So 2 questions - what problem did you encounter?
and why no VBA?

As this would be simple in code, and most of the contributors here don't use macro's.
 
I also don't use macros but it really is easy in VBA
Not sure why you want to include the list index but up to you

Create code similar to this:

Code:
Private Sun List2_Click()

MsgBox "You selected " & Me.List2.Column(1) & " " & Me.List2.ListIndex

End Sub

If you really want a macro, try the syntax shown above
 
Thanks All.
This is the error message I am getting.

Object does not contain the automation object 'Me'

I am trying to learn Macros because they are cool and easy for some occasions. I want to be well rounded. Macro have saved me lots of time in the past.
 
This is the error message I am getting.

Object does not contain the automation object 'Me'

Sorry - no idea

I am trying to learn Macros because they are cool and easy for some occasions. I want to be well rounded. Macro have saved me lots of time in the past.

Using macros certainly aren't saving you time here.... :D
 
Is this on a web access data form ?
 
i dont use them but I believe you may need to use the full form reference in a macro- forms!Myform.MyControl, as oppsed to using Me.MyControl
 
Hi Grenee,
I suspect you put your post in the "Modules & VBA" section by mistake, because it is next to the "Macros" section in the Forum Home Page list. Most VBA types (me included) try to avoid macros, but in that other section you might find more Macro specialists.
 

Users who are viewing this thread

Back
Top Bottom