|
-
Apr 25th, 2002, 10:36 AM
#1
Thread Starter
Lively Member
if then - text to labelbox
I've another problem - what is the best way to implement this?
desired text is read to label1.caption (this part working), now if the label1.caption has the words intranet in it then label6 should contain technology is firewall. I tried an if then statement after the .txt was read to label1.caption.
Thanks.
-
Apr 25th, 2002, 10:39 AM
#2
Bouncy Member
VB Code:
If InStr(Label1.Caption, "Intranet") > 0 Then Label6.Caption = "technology is firewall"
-
Apr 25th, 2002, 10:40 AM
#3
Bouncy Member
note the InStr function actually returns the character postition of the word searched for in the string specified usually, or zero if it wasnt found
-
Apr 25th, 2002, 10:47 AM
#4
Thread Starter
Lively Member
Brilliant - its working, now i need to apply this to the other label boxes within the forms, which will take a while!
Appreciated & grateful - Thanks a lot!
-
Apr 25th, 2002, 10:52 AM
#5
-
Apr 25th, 2002, 10:58 AM
#6
Thread Starter
Lively Member
Sorry - one other query:
what if label1 contains the text intranet and extranet, or just intranet or just extranet, I tried this but not working:
If InStr(Label1.Caption, "Intranet") and _
(Label1.Caption, "extranet") > 0 Then
Label6.Caption = "firewall."
End If
If InStr(Label1.Caption, "Intranet") or _
(Label1.Caption, "extranet") > 0 Then
Label6.Caption = "firewall."
End If
Whats the best way to implement this?
Thanks.
-
Apr 25th, 2002, 11:03 AM
#7
Bouncy Member
just a quick question, can you just use the .Text property or are these values always going to be in the middle of someother text.....?
-
Apr 25th, 2002, 11:15 AM
#8
Thread Starter
Lively Member
Not too sure what you mean:
my project is this: q1 form: what do you use the internet for with checkboxes and selected ones are stored to q1.txt, q2 form: what technologies do you use with checkboxes and selected ones are stored to q2.txt, q3 form: what legal laws do you know/use with checkboxes and selected ones are stored to q3.txt - eventually user comes to the recommendation form, which the selected answers to q1,2,3 forms are read to the label boxes, so depending on what internet use, then with if then statements i recommend other technologies and legal laws they should use.
-
Apr 25th, 2002, 11:26 AM
#9
Originally posted by P Lee
Sorry - one other query:
what if label1 contains the text intranet and extranet, or just intranet or just extranet, I tried this but not working:
If InStr(Label1.Caption, "Intranet") and _
(Label1.Caption, "extranet") > 0 Then
Label6.Caption = "firewall."
End If
If InStr(Label1.Caption, "Intranet") or _
(Label1.Caption, "extranet") > 0 Then
Label6.Caption = "firewall."
End If
Whats the best way to implement this?
Thanks.
Don't you need to declare each section of the if statement? like so
if intStr(Label1.caption, "intranet") > 0 or instStr(lable1.caption,"extranet") > 0 then
-
Apr 25th, 2002, 11:38 AM
#10
Thread Starter
Lively Member
Thanks, my proj is turning out to be a nightmare, with all the different recommendations of technology, legal laws, what should contain in the risk assessment, policy plan depending on what the internet use was chosen!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|