Rabu, 13 Januari 2016

Re: [MS_AccessPros] IIF

 

Kevin-


Tough to help if you don't tell us what you expect to get.  And what is ELookup?

Your expression basically says:

If TypeID = 1 then "ELookup" where ReportTextID is 1
If TypeID = 2 then "ELookup" where ReportTextID is 96
If TypeID = 3 then "Elookup" where ReportTextID is 97

.. but you have nothing defined if none of the three is true.
Maybe you want:

=IIf([ItineraryRemarkTypeID]=1,ELookup("ReportText","tblReportText","ReportTextID=" & 1),IIf([ItineraryRemarkTypeID]=2,ELookup("ReportText","tblReportText","ReportTextID=" & 96,IIf([ItineraryRemarkTypeID]=3,ELookup("ReportText","tblReportText","ReportTextID=" & 97), "Invalid Type ID"))))

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Jan 13, 2016, at 10:22 AM, 'zhaoliqingoffice@163.com' zhaoliqingoffice@163.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Dear All,
Please check what wrong with my code, I didn't get the expected result. Thanks in advance.
=IIf([ItineraryRemarkTypeID]=1,ELookup("ReportText","tblReportText","ReportTextID=" & 1),IIf([ItineraryRemarkTypeID]=2,ELookup("ReportText","tblReportText","ReportTextID=" & 96,IIf([ItineraryRemarkTypeID]=3,ELookup("ReportText","tblReportText","ReportTextID=" & 97)))))
Best Regards,
Kevin



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Poskan Komentar