visible

R

rml

I'm using the following code in the onCurrent. I would like to check if in
field aaa the value starts with NP-66 then label403 be visible. Can anyone
provide me with the correct code?

Thanks.

If [aaa] = "NP-66*" then label403.visible = true
else label403.visible = false
 
F

fredg

I'm using the following code in the onCurrent. I would like to check if in
field aaa the value starts with NP-66 then label403 be visible. Can anyone
provide me with the correct code?

Thanks.

If [aaa] = "NP-66*" then label403.visible = true
else label403.visible = false

Me.[Label403].Visible = Left(Me.[aaa],3) = "NP-66"

If data can be entered or changed in the [aaa] control, place the same
code in the [aaa] AfterUpdate event.

I would suggest you use meaningful field and label control names.
6 months from now, when you look at your code, you're not going to
remember what [aaa] or [Label403] represent.
 
R

Ryan

You were very close. This should work for you.
If Me.aaa = "NP-66" Then
Me.label403.visisble = True
End If
 
T

Tony

rml said:
I'm using the following code in the onCurrent. I would like to check if
in
field aaa the value starts with NP-66 then label403 be visible. Can
anyone
provide me with the correct code?

Thanks.

If [aaa] = "NP-66*" then label403.visible = true
else label403.visible = false

fredg is correct, except in the Left statement, I think it should be 5
instead of 3.

Me.[Label403].Visible = Left(Me.[aaa],5) = "NP-66"
 
R

rml

Thanks. I think this will work but I'm looking for value that start with
NP-66.
Example: A value might be NP-6654-542 So, how would that code look? NP-66*

Thanks.

Ryan said:
You were very close. This should work for you.
If Me.aaa = "NP-66" Then
Me.label403.visisble = True
End If
--
Please remember to mark this as answered if this solves your problem.


rml said:
I'm using the following code in the onCurrent. I would like to check if in
field aaa the value starts with NP-66 then label403 be visible. Can anyone
provide me with the correct code?

Thanks.

If [aaa] = "NP-66*" then label403.visible = true
else label403.visible = false
 
R

Ron2006

If left([aaa],5) = "NP-66" then
label403.visible = true
else
label403.visible = false
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top