Assigning a value

S

Sandy H

I have created a little form based help screen and I am just having a minor
problem.

I have a form with a list box on it. The list box has three columns but only
the second one is visible.

HelpID Topic LinkName
1 Introduction Hintro
2 Main Features HFeatures
3 Other Features HOther
etc

The LinkName is the name of a hidden label (with the help info) on the form.

When the user clicks a list item, it does the following:

Dim strName As String

strName = Me.lstHelp.Column(2)
Me.strName.Visible = True

This doesn't work and I get a syntax error in the last line. What is the
correct way to write this code.

Thanks in advance.
Sandy
 
W

Wayne Morgan

You would need to adjust the column width, but that will make it visible for all the
entries, not just the one you clicked on. You could place a textbox next to the list box
and place the value from the 3rd column in it for the row selected. Set the Control Source
of the textbox to

=lstHelp.Column(2)
 
A

Andy Cole

Sandy

As I read it, your form has at least 3 label controls which are 'hidden'
when the form loads. When an Item is selected in the list you 'unhide' the
required label. If my understanding is correct then your last line should
be;

Me.Controls(strName).Visible = True

HTH

Andy
 
Top