Connecting Tech Pros Worldwide Help | Site Map

Formula help

Newbie
 
Join Date: Oct 2009
Location: London
Posts: 17
#1: 4 Weeks Ago
Hi All,

This is prob easy but I have the below formula that is not working, how do I include an And statement within the IsNull to look at 2 combo boxes ? I have tried to do it a couple of ways but get the same error "Type Mismatch"

Expand|Select|Wrap|Line Numbers
  1.  
  2. If IsNull([ComboBox]) And ([ComboBox]) Then
  3. [ComboBox] = Null
  4. End If
  5.  
  6.  

Thanks
best answer - posted by ChipR
IsNull only takes one parameter, so you'd have to do it twice.
Expand|Select|Wrap|Line Numbers
  1. If IsNull(control) And IsNull(otherControl) Then
  2.   ...
  3. End If
Expert
 
Join Date: Jul 2008
Location: Maryland
Posts: 1,158
#2: 4 Weeks Ago

re: Formula help


IsNull only takes one parameter, so you'd have to do it twice.
Expand|Select|Wrap|Line Numbers
  1. If IsNull(control) And IsNull(otherControl) Then
  2.   ...
  3. End If
Newbie
 
Join Date: Oct 2009
Location: London
Posts: 17
#3: 4 Weeks Ago

re: Formula help


Thanks ChipR - the only thing I did not try !!!!!
Thanks again
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,672
#4: 4 Weeks Ago

re: Formula help


It's possible to use :
Expand|Select|Wrap|Line Numbers
  1. If IsNull(Control+OtherControl) Then
  2. ...
  3. End If
but it is a little esoteric and relies on Null propagation.

I'd actually recommend Chip's answer in most cases.
ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,213
#5: 4 Weeks Ago

re: Formula help


Quote:

Originally Posted by NeoPa View Post

It's possible to use :

Expand|Select|Wrap|Line Numbers
  1. If IsNull(Control+OtherControl) Then
  2. ...
  3. End If
but it is a little esoteric and relies on Null propagation.

I'd actually recommend Chip's answer in most cases.

Getting esoteric on us, hey NeoPa! (LOL)!
Reply


Similar Microsoft Access / VBA bytes