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 / May 2005

Tip: Looking for answers? Try searching our database.

DLookup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeffmklein - 26 May 2005 01:45 GMT
I am trying to create a check in my form that looks for any duplicate client
names.  I am using the below code to return the ClientID value if a record
is found.

DLookup("[ClientID]", "[Clients]", "[ClientLastName] =
Form.[ClientLastName]")

This works OK but I have seperate fields for the ClientFirstName and
ClientLastName
So I try:
DLookup("[ClientID]", "[Clients]", "[ClientLastName]&[ClientFirstName] =
Form.[ClientLastName]&[ClientFirstName]")
This is not working.  I think DLookup does not like combining the lookup
fields.

Any suggestions on a solution???
tina - 26 May 2005 01:57 GMT
DLookup("[ClientID]", "Clients", "[ClientLastName] = '" & [ClientLastName] &
"' And [ClientFirstName] = '" & [ClientFirstName] & "'")

the syntax may change slightly depending on exactly where you're using this
expression (macro condition, VBA code, etc.).

hth

> I am trying to create a check in my form that looks for any duplicate client
> names.  I am using the below code to return the ClientID value if a record
[quoted text clipped - 12 lines]
>
> Any suggestions on a solution???
JeffMKlein - 26 May 2005 02:03 GMT
Tina,
Thanks for the reply.  This seems to work great.  Thank you very much
Jeff

> DLookup("[ClientID]", "Clients", "[ClientLastName] = '" & [ClientLastName] &
> "' And [ClientFirstName] = '" & [ClientFirstName] & "'")
[quoted text clipped - 21 lines]
> >
> > Any suggestions on a solution???
tina - 26 May 2005 05:44 GMT
you're welcome  :)

> Tina,
> Thanks for the reply.  This seems to work great.  Thank you very much
[quoted text clipped - 28 lines]
> > >
> > > Any suggestions on a solution???
 
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



©2008 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.