#ERROR question

  • Thread starter Elmtree via AccessMonster.com
  • Start date
E

Elmtree via AccessMonster.com

My formula:

Mid([f1],InStr(10,[f1],": ")-1)

returns #ERROR if the value is blank, otherwise works fine. Any ideas how to
change my formula to get beyond the #ERROR?


Access 2007.


Thanks

mike
 
J

John Spencer MVP

Test first
IIF(F1 Like "?????????*: *",Mid(Instr(10,F1,": ")-1),Null)

Or if it is only nulls that are failing
IIF(F1 is Not Null,Mid([f1],InStr(10,[f1],": ")-1) ,Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Top