Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

Dlookup inside IIf in 2 Table Update Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cleech - 23 Apr 2008 22:10 GMT
Hello all:
I'm trying to do something a little funky here and I'm not sure if I'm
approaching it the right way.

I'm running an update query that will contain SocSec numbers for 4
different fields.  Obviously each one needs to be different for each
record and each field.  I am taking the SocSec numbers from a table
that has each number listed along with an identifier (2,3,4,5) to
bring them into the correct fields.

What I'm trying, unscuccessfully, right now is the following:

IIf(Left([dbo_tblAIR_SUPmo]![txtRider1],3)="AIR",
(DLookUp("[SocialSec]","dbo_tblSocialSecurity",[dbo_tblSocialSecurity]!
[MOnumber]=[dbo_tbl5YT_CTPmo]![lngMOnum] And [dbo_tblSocialSecurity]!
[Insured]=2)),Null)

This does not work and I'm not sure that it can.  When the I run the
update query, I get parameter prompts for [dbo_tblSocialSecurity]!
[MOnumber] and [dbo_tblSocialSecurity]![Insured].
Table [dbo_tblSocialSecurity] is not part of the query.  I'm not sure
if this matters either.

Essentially what I would like to do is accomplish inserting these
SocSec numbers in this one update query.  I know I can add
[dbo_tblSocialSecurity] to the query and have identifier criteria of
2, but this would involve running the query 4 times.

As always, any help is greatly aprreciated.
John Spencer - 24 Apr 2008 13:14 GMT
First, your DLookup does not appear to be structured properly.

IIf(Left([dbo_tblAIR_SUPmo]![txtRider1],3)="AIR",
DLookUp("[SocialSec]","dbo_tblSocialSecurity","[MOnumber]=" &
[dbo_tbl5YT_CTPmo]![lngMOnum] & " And Insured=2"),Null)

That assumes that [dbo_tbl5YT_CTPmo] is a table in the query and that
[dbo_tbl5YT_CTPmo]![lngMOnum] is a number field.

Beyond that it is difficult to say what you need to do.
You have not posted the SQL you are attempting to use and we have no idea of
the table structure(s) involved.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

> Hello all:
> I'm trying to do something a little funky here and I'm not sure if I'm
[quoted text clipped - 25 lines]
>
> As always, any help is greatly aprreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.