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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query--using Access 2007



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 1st, 2010, 08:06 PM posted to microsoft.public.access
lmcc via AccessMonster.com
external usenet poster
 
Posts: 3
Default Query--using Access 2007

I have a tblAddress table with a lookup field called TypeofAddressID.

A company may have many addresses with different TypeofAddressID—such as 1 =
Business, 2 = Mailstop, 3 = PO Box, and so on.

I need to pull out TypeofAddressID # 1. Then if a 1 is not available, give
me the type that is (which may be the PO address or Mailstop).

I tried DLookup, Xor, and IIf([TypeofAddressID]=1, 1, IIf([TypeofAddressID]=2,
2, IIf([TypeofAddressID]=3, 3, 4))), but it is listing all addresses per
company instead of either or.

Any suggestions?

--
Message posted via http://www.accessmonster.com

 




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 06:47 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.