| | |
IF THEN ELSE Statement
![]() |
Yes , no doubt you can do that ,
It is useful when you need to check same condition or to create an advanced search !
I used this when i created an interacting program test.It started like this :
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
IF CUST= "A" OR CUST = "B" OR CUST = "C" THEN CUST = "A , B ,C "
I used this when i created an interacting program test.It started like this :
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If Text1.Text = "what is your name" Or Text1.Text = "name please" Or Text1.Text = "who are you" Then MsgBox "My name is System" ElseIf Text1.Text = "how old are you" Or Text1.Text = "age please" Then MsgBox "i am 10 years old !" ElseIf Text1.Text = "please help me" Or Text1.Text = "i need help" Or Text1.Text = "look at me" Then MsgBox "yes , tell me your problem !" End If
Last edited by Vineeth K; Sep 23rd, 2009 at 12:24 pm.
Who wants to be a GOD ??
•
•
•
•
I'm not sure what exactly you want to do here. Do you want to call specific data and then only show that data? If that data is not available do you want to show all the data?
Please be more specific, and I'm sure we can help here.
I obly want to call the specific data only that is A,B & C. If i input either one a ,or b it will call out thre data of all the ABC one
Not that code , this one also work and this is used for more advanced search or security control.In this case the program will work only after comparing 2 conditions at the same time !
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If Text1.Text = "what is your name" And Text2.Text = "name please" Then MsgBox "My name is System" ElseIf Text1.Text = "how old are you" And Text2.Text = "age please" Then MsgBox "i am 10 years old !" ElseIf Text1.Text = "please help me" And Text2.Text = "i need help" Then MsgBox "yes , tell me your problem !" End If
Who wants to be a GOD ??
•
•
Join Date: Sep 2009
Posts: 57
Reputation:
Solved Threads: 8
simple code
or more
or more
vb Syntax (Toggle Plain Text)
if a=a or b=b or c=c and d=d then f=f 'or if a=a or b=b or c=c and d=d then f=f end if
vb Syntax (Toggle Plain Text)
if a=a or b=b or c=c and d=d then f=f else f=g end if
or more
vb Syntax (Toggle Plain Text)
if a=a or b=b or c=c and d=d then f=f elseif c=c and d=d then f=h elseif d=d then f=i else f=g end if
Last edited by omoridi; Sep 28th, 2009 at 11:48 am.
•
•
Join Date: Sep 2009
Posts: 57
Reputation:
Solved Threads: 8
i donot know what u want exacly but if vb have iif maybe it work for u
this syntax like thsi
vb Syntax (Toggle Plain Text)
a=iif(b=c,d,f)
this syntax like thsi
vb Syntax (Toggle Plain Text)
if b=c then a=d else a=f end if
![]() |
Similar Threads
- missing return statement (Java)
- MySQL LIKE statement (MySQL)
- loop in main function to an "if" statement (C++)
- Switch Case Statement (Java)
- run sql statement in asp (ASP)
- switch/case statement (C++)
- change statement (JSP)
- Reading MSWord Document through an ASP Statement (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: ctrl question...
- Next Thread: Playing .Wav/MIDI files in a Visual Basic Program
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





