Solved

DLoopkup function on MS/Access 2010 yels ?name or #error

Posted on 2011-03-23
3
333 Views
Last Modified: 2013-11-28
I a just starting to use ms/access 2010 and have a small db wuth 3 tables: [beneficiario], [ordempagamento] and [projetos].

I am trying to build a form for [ordempagamento] that, from an input code (a name) would retrieve an address from [beneficiario].

So I am using the following sysntax:

= Dlookup ("Morada";"Beneficiarios";"Nome =" & [FormNomeBeneficiario])

It would not work, yelding #error as a return

also tried:

=DLookUp([Beneficiarios].[Morada];[Beneficiarios];[Beneficiarios].[Nome]=[NomeBeneficiario])

and

= Dlookup ("[Morada]";"[Beneficiarios]";"[Nome] =" & [FormNomeBeneficiario])

could nor pit to work

I am attachiing the database

can anyone help? formulariosFEDON.accdb
0
Comment
Question by:jirdeaid
  • 2
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 35200653
The lookup should be..

=DLookUp("[Morada]","[beneficiarios]","[Nome]='" & [formNomeBeneficiario] & "'")

Ypu also need to add a command into the FormNomeBeneficiario combo box afterupdate event procedure..

me.text49.requery
0
 

Author Comment

by:jirdeaid
ID: 35200887
THANKS!!!! it worked!
0
 

Author Closing Comment

by:jirdeaid
ID: 35200908
perfect!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question