Access 2003/2007 Dlookup Control on Form will Not Populate Date

Posted on 2007-10-04
Last Modified: 2013-11-28
I have a form in Access 2007 (a 2003 database) and I have a simple Dlookup control.  

=DLookUp("FacilityName","tblFacilities","[FacilityNo]= Forms!frmNonComp!Facility")

The control works, but will only show the data when I click on it.  When I change the form to the next record it continues showing data for each record, but will not show data for a new record.  When I close the form and then reopen it, it comes up blank again.

I cannot figure this out.
Question by:dvelasquez
    1 Comment
    LVL 10

    Accepted Solution

    You need to add this to the On Current event:

    me.Myfield = DLookUp("FacilityName","tblFacilities","[FacilityNo]= Forms!frmNonComp!Facility")

    That way it will be regularly updated.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    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…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now