A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#ERROR question



 
 
Thread Tools Display Modes
  #1  
Old June 19th, 2009, 07:32 PM posted to microsoft.public.access.queries
Elmtree via AccessMonster.com
external usenet poster
 
Posts: 5
Default #ERROR question

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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200906/1

  #2  
Old June 19th, 2009, 08:29 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default #ERROR question

Test it first --

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



"Elmtree via AccessMonster.com" wrote:

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

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200906/1


  #3  
Old June 19th, 2009, 08:41 PM posted to microsoft.public.access.queries
John Spencer MVP
external usenet poster
 
Posts: 533
Default #ERROR question

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

Elmtree via AccessMonster.com wrote:
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

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.