PC Review


Reply
Thread Tools Rate Thread

'OR' Condition

 
 
=?Utf-8?B?TWF0dHM=?=
Guest
Posts: n/a
 
      7th Aug 2007
Hi,
Is there a limit to the no of 'OR's in a statement, cos in the below condition
the 1st 6 conditions get checked, but not the last checking criteria
[*****],refer below.
(also another simple Q, how can i break the lenght of the code
& continue typing it on a next line ?)

If Me.CboSubType.Value = "Blue" Or
Me.CboSubType.Value = "Blue MGM" Or
Me.CboSubType.Value = "Gold" Or
Me.CboSubType.Value = "Gold MGM" Or
Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]" Or
Me.CboSubType.Value = "Citi-Plus" Or
Me.CboSubType.Value = "CG Fee Account" [*******] doesnt check this ! !
AND
Me.CboType = "New to Bank" Then
Me.Label7.Visible = False
Me.txtVlu.Visible = False
Else
Me.Label7.Visible = True
Me.txtVlu.Visible = True
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      7th Aug 2007
Easy

TempOR1 = (Me.CboSubType.Value = "Blue") Or _
(Me.CboSubType.Value = "Blue MGM") Or _
(Me.CboSubType.Value = "Gold") Or _
(Me.CboSubType.Value = "Gold MGM")

TempOR2 = (Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]") Or _
(Me.CboSubType.Value = "Citi-Plus") Or _
(Me.CboSubType.Value = "CG Fee Account")

if (TempOR1 or TempOR2) and (Me.CboType = "New to Bank") then
Me.Label7.Visible = False
Me.txtVlu.Visible = False
Else
Me.Label7.Visible = True
Me.txtVlu.Visible = True

"Matts" wrote:

> Hi,
> Is there a limit to the no of 'OR's in a statement, cos in the below condition
> the 1st 6 conditions get checked, but not the last checking criteria
> [*****],refer below.
> (also another simple Q, how can i break the lenght of the code
> & continue typing it on a next line ?)
>
> If Me.CboSubType.Value = "Blue" Or
> Me.CboSubType.Value = "Blue MGM" Or
> Me.CboSubType.Value = "Gold" Or
> Me.CboSubType.Value = "Gold MGM" Or
> Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]" Or
> Me.CboSubType.Value = "Citi-Plus" Or
> Me.CboSubType.Value = "CG Fee Account" [*******] doesnt check this ! !
> AND
> Me.CboType = "New to Bank" Then
> Me.Label7.Visible = False
> Me.txtVlu.Visible = False
> Else
> Me.Label7.Visible = True
> Me.txtVlu.Visible = True

 
Reply With Quote
 
=?Utf-8?B?TWF0dHM=?=
Guest
Posts: n/a
 
      7th Aug 2007
Hi Joel,
Only the first half is getting checked (TempOR1).
Doesnt seem to work for the values in the (TempOR2) argument.

What next ?

"Joel" wrote:

> Easy
>
> TempOR1 = (Me.CboSubType.Value = "Blue") Or _
> (Me.CboSubType.Value = "Blue MGM") Or _
> (Me.CboSubType.Value = "Gold") Or _
> (Me.CboSubType.Value = "Gold MGM")
>
> TempOR2 = (Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]") Or _
> (Me.CboSubType.Value = "Citi-Plus") Or _
> (Me.CboSubType.Value = "CG Fee Account")
>
> if (TempOR1 or TempOR2) and (Me.CboType = "New to Bank") then
> Me.Label7.Visible = False
> Me.txtVlu.Visible = False
> Else
> Me.Label7.Visible = True
> Me.txtVlu.Visible = True
>
> "Matts" wrote:
>
> > Hi,
> > Is there a limit to the no of 'OR's in a statement, cos in the below condition
> > the 1st 6 conditions get checked, but not the last checking criteria
> > [*****],refer below.
> > (also another simple Q, how can i break the lenght of the code
> > & continue typing it on a next line ?)
> >
> > If Me.CboSubType.Value = "Blue" Or
> > Me.CboSubType.Value = "Blue MGM" Or
> > Me.CboSubType.Value = "Gold" Or
> > Me.CboSubType.Value = "Gold MGM" Or
> > Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]" Or
> > Me.CboSubType.Value = "Citi-Plus" Or
> > Me.CboSubType.Value = "CG Fee Account" [*******] doesnt check this ! !
> > AND
> > Me.CboType = "New to Bank" Then
> > Me.Label7.Visible = False
> > Me.txtVlu.Visible = False
> > Else
> > Me.Label7.Visible = True
> > Me.txtVlu.Visible = True

 
Reply With Quote
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      7th Aug 2007
As I thought, the problem wasn't with the number of ORs strung together. The
is either a typo, a exttra blank character or an invisible character in the
string you are searching.

try something like this

for i = 1 to len(mystring)
msgbox("Char: " & i & "=" & _
mid(mystring,1,1) & "=" & _
asc(mid(mystring,1,1)))
next i

"Matts" wrote:

> Hi Joel,
> Only the first half is getting checked (TempOR1).
> Doesnt seem to work for the values in the (TempOR2) argument.
>
> What next ?
>
> "Joel" wrote:
>
> > Easy
> >
> > TempOR1 = (Me.CboSubType.Value = "Blue") Or _
> > (Me.CboSubType.Value = "Blue MGM") Or _
> > (Me.CboSubType.Value = "Gold") Or _
> > (Me.CboSubType.Value = "Gold MGM")
> >
> > TempOR2 = (Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]") Or _
> > (Me.CboSubType.Value = "Citi-Plus") Or _
> > (Me.CboSubType.Value = "CG Fee Account")
> >
> > if (TempOR1 or TempOR2) and (Me.CboType = "New to Bank") then
> > Me.Label7.Visible = False
> > Me.txtVlu.Visible = False
> > Else
> > Me.Label7.Visible = True
> > Me.txtVlu.Visible = True
> >
> > "Matts" wrote:
> >
> > > Hi,
> > > Is there a limit to the no of 'OR's in a statement, cos in the below condition
> > > the 1st 6 conditions get checked, but not the last checking criteria
> > > [*****],refer below.
> > > (also another simple Q, how can i break the lenght of the code
> > > & continue typing it on a next line ?)
> > >
> > > If Me.CboSubType.Value = "Blue" Or
> > > Me.CboSubType.Value = "Blue MGM" Or
> > > Me.CboSubType.Value = "Gold" Or
> > > Me.CboSubType.Value = "Gold MGM" Or
> > > Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]" Or
> > > Me.CboSubType.Value = "Citi-Plus" Or
> > > Me.CboSubType.Value = "CG Fee Account" [*******] doesnt check this ! !
> > > AND
> > > Me.CboType = "New to Bank" Then
> > > Me.Label7.Visible = False
> > > Me.txtVlu.Visible = False
> > > Else
> > > Me.Label7.Visible = True
> > > Me.txtVlu.Visible = True

 
Reply With Quote
 
=?Utf-8?B?TWF0dHM=?=
Guest
Posts: n/a
 
      7th Aug 2007
Your right Joel. Was a character mismatch.
Thanks a ton. Works brilliant.

"Joel" wrote:

> As I thought, the problem wasn't with the number of ORs strung together. The
> is either a typo, a exttra blank character or an invisible character in the
> string you are searching.
>
> try something like this
>
> for i = 1 to len(mystring)
> msgbox("Char: " & i & "=" & _
> mid(mystring,1,1) & "=" & _
> asc(mid(mystring,1,1)))
> next i
>
> "Matts" wrote:
>
> > Hi Joel,
> > Only the first half is getting checked (TempOR1).
> > Doesnt seem to work for the values in the (TempOR2) argument.
> >
> > What next ?
> >
> > "Joel" wrote:
> >
> > > Easy
> > >
> > > TempOR1 = (Me.CboSubType.Value = "Blue") Or _
> > > (Me.CboSubType.Value = "Blue MGM") Or _
> > > (Me.CboSubType.Value = "Gold") Or _
> > > (Me.CboSubType.Value = "Gold MGM")
> > >
> > > TempOR2 = (Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]") Or _
> > > (Me.CboSubType.Value = "Citi-Plus") Or _
> > > (Me.CboSubType.Value = "CG Fee Account")
> > >
> > > if (TempOR1 or TempOR2) and (Me.CboType = "New to Bank") then
> > > Me.Label7.Visible = False
> > > Me.txtVlu.Visible = False
> > > Else
> > > Me.Label7.Visible = True
> > > Me.txtVlu.Visible = True
> > >
> > > "Matts" wrote:
> > >
> > > > Hi,
> > > > Is there a limit to the no of 'OR's in a statement, cos in the below condition
> > > > the 1st 6 conditions get checked, but not the last checking criteria
> > > > [*****],refer below.
> > > > (also another simple Q, how can i break the lenght of the code
> > > > & continue typing it on a next line ?)
> > > >
> > > > If Me.CboSubType.Value = "Blue" Or
> > > > Me.CboSubType.Value = "Blue MGM" Or
> > > > Me.CboSubType.Value = "Gold" Or
> > > > Me.CboSubType.Value = "Gold MGM" Or
> > > > Me.CboSubType.Value = "Citi-Access [Sal. Dom Only]" Or
> > > > Me.CboSubType.Value = "Citi-Plus" Or
> > > > Me.CboSubType.Value = "CG Fee Account" [*******] doesnt check this ! !
> > > > AND
> > > > Me.CboType = "New to Bank" Then
> > > > Me.Label7.Visible = False
> > > > Me.txtVlu.Visible = False
> > > > Else
> > > > Me.Label7.Visible = True
> > > > Me.txtVlu.Visible = True

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup with multiple condition, but one condition to satisfy is en =?Utf-8?B?RWRkeSBTdGFu?= Microsoft Excel Worksheet Functions 2 27th Oct 2007 02:06 PM
Combine an OR condition with an AND condition =?Utf-8?B?V2lsbA==?= Microsoft Excel Misc 1 6th Apr 2007 03:52 PM
Help with syntax for WHERE condition or just Condition =?Utf-8?B?U3VlIENvbXBlbGxpbmc=?= Microsoft Access Macros 0 22nd Jun 2005 08:11 AM
I need 4 condition for condition formatting =?Utf-8?B?U2VlS1k=?= Microsoft Excel Programming 2 7th Jun 2005 09:49 AM
Condition is true in one cell, give me same condition in another T. Harris Microsoft Excel Misc 1 28th May 2004 08:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:29 AM.