Help...Am I heading in the right direction??? 
Author Message
 Help...Am I heading in the right direction???

Hello,
I am trying to write a code that will show a lable next to a position (job)
if that position shows it is Assistant Manager. Below is what I have written
so far...how far off track am I?
Thanks...
Public Sub LabelHide()
    If [Position] = "Assistant Manager" Then
        Label18.Visible = True
        [Label18Name] = "Management Position!"
        [Label18Name] = RGB(255, 0, 0)
    Else
        [Position] = "" <--(Do not know what to put here)
        Label18.Visible = False
    End If
End Sub

: )



Wed, 02 Apr 2003 03:00:00 GMT  
 Help...Am I heading in the right direction???

I think I'd set the Caption and Color properties in the property box of the
label and then just code this.  You don't really need to know or set the
[Position] value in the Else statement because whatever is in the [Position]
field won't be visible if the code  makes it to the Else clause.

Public Sub LabelHide()
    If [Position] = "Assistant Manager" Then
        Label18.Visible = True
    Else
        Label18.Visible = False
    End If
End Sub


Quote:

>Hello,
>I am trying to write a code that will show a lable next to a position (job)
>if that position shows it is Assistant Manager. Below is what I have written
>so far...how far off track am I?
>Thanks...
>Public Sub LabelHide()
>    If [Position] = "Assistant Manager" Then
>        Label18.Visible = True
>        [Label18Name] = "Management Position!"
>        [Label18Name] = RGB(255, 0, 0)
>    Else
>        [Position] = "" <--(Do not know what to put here)
>        Label18.Visible = False
>    End If
>End Sub



Wed, 02 Apr 2003 03:00:00 GMT  
 Help...Am I heading in the right direction???
Thanks..I will try that...
: )


Quote:

> I think I'd set the Caption and Color properties in the property box of
the
> label and then just code this.  You don't really need to know or set the
> [Position] value in the Else statement because whatever is in the
[Position]
> field won't be visible if the code  makes it to the Else clause.

> Public Sub LabelHide()
>     If [Position] = "Assistant Manager" Then
>         Label18.Visible = True
>     Else
>         Label18.Visible = False
>     End If
> End Sub



> >Hello,
> >I am trying to write a code that will show a lable next to a position
(job)
> >if that position shows it is Assistant Manager. Below is what I have
written
> >so far...how far off track am I?
> >Thanks...
> >Public Sub LabelHide()
> >    If [Position] = "Assistant Manager" Then
> >        Label18.Visible = True
> >        [Label18Name] = "Management Position!"
> >        [Label18Name] = RGB(255, 0, 0)
> >    Else
> >        [Position] = "" <--(Do not know what to put here)
> >        Label18.Visible = False
> >    End If
> >End Sub



Wed, 02 Apr 2003 03:00:00 GMT  
 Help...Am I heading in the right direction???
I entered the sub as you stated...but the caption Management Position! is
still showing even when the Assistant Manager position reads something else
i.e. Salesclerk...etc...
I entered into the Caption label but that makes it constant.
Any more ideas?
: )
Quote:



> > I think I'd set the Caption and Color properties in the property box of
> the
> > label and then just code this.  You don't really need to know or set the
> > [Position] value in the Else statement because whatever is in the
> [Position]
> > field won't be visible if the code  makes it to the Else clause.

> > Public Sub LabelHide()
> >     If [Position] = "Assistant Manager" Then
> >         Label18.Visible = True
> >     Else
> >         Label18.Visible = False
> >     End If
> > End Sub



> > >Hello,
> > >I am trying to write a code that will show a lable next to a position
> (job)
> > >if that position shows it is Assistant Manager. Below is what I have
> written
> > >so far...how far off track am I?
> > >Thanks...
> > >Public Sub LabelHide()
> > >    If [Position] = "Assistant Manager" Then
> > >        Label18.Visible = True
> > >        [Label18Name] = "Management Position!"
> > >        [Label18Name] = RGB(255, 0, 0)
> > >    Else
> > >        [Position] = "" <--(Do not know what to put here)
> > >        Label18.Visible = False
> > >    End If
> > >End Sub



Wed, 02 Apr 2003 03:00:00 GMT  
 Help...Am I heading in the right direction???

What event are you calling the LabelHide() sub from?

You need to find the Position_Change event and call it from there so it gets
executed every time the value in the Postion box or field changes.

  Private Sub Position_Change()
      LabelHide
  End Sub

Albert


Quote:

>I entered the sub as you stated...but the caption Management Position! is
>still showing even when the Assistant Manager position reads something else
>i.e. Salesclerk...etc...
>I entered into the Caption label but that makes it constant.
>Any more ideas?
>: )



>> > I think I'd set the Caption and Color properties in the property box of
>> the
>> > label and then just code this.  You don't really need to know or set the
>> > [Position] value in the Else statement because whatever is in the
>> [Position]
>> > field won't be visible if the code  makes it to the Else clause.

>> > Public Sub LabelHide()
>> >     If [Position] = "Assistant Manager" Then
>> >         Label18.Visible = True
>> >     Else
>> >         Label18.Visible = False
>> >     End If
>> > End Sub



>> > >Hello,
>> > >I am trying to write a code that will show a lable next to a position
>> (job)
>> > >if that position shows it is Assistant Manager. Below is what I have
>> written
>> > >so far...how far off track am I?
>> > >Thanks...
>> > >Public Sub LabelHide()
>> > >    If [Position] = "Assistant Manager" Then
>> > >        Label18.Visible = True
>> > >        [Label18Name] = "Management Position!"
>> > >        [Label18Name] = RGB(255, 0, 0)
>> > >    Else
>> > >        [Position] = "" <--(Do not know what to put here)
>> > >        Label18.Visible = False
>> > >    End If
>> > >End Sub



Wed, 02 Apr 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Am I in the right direction

2. Help, I am wading in over my head!

3. Help a beginner by pointing in the right direction

4. Help: could someone point me in the right direction

5. Need a direction to head...

6. Please point me in the right direction!

7. Pointer in the right Direction.

8. Please point me in the right direction...

9. Experienced Programmer needs quick shove in the right direction

10. Need a point in the right direction...

11. Can someone put me to the right direction, please

12. Wanted: A point in the right direction.

 

 
Powered by phpBB® Forum Software