How populate field on a form with DLast

Posted on 2011-10-21
Last Modified: 2013-11-05
I have a main form that has a text box which I'd like to populate with a DLast when the form opens.  I've put the following in both the onopen and onload event of the form but get an error...

"You can't assign a value to this object".

Here's my code.  What's wrong with it?

Me.txtdbVersionN = DLast("dbVersion", "tblDatabaseVersion")

Question by:SteveL13
    LVL 119

    Accepted Solution

    how about using DMax instead

    Me.txtdbVersionN = DMax("dbVersion", "tblDatabaseVersion")

    Author Comment

    Am getting the same error message with DMax.  ??
    LVL 119

    Expert Comment

    by:Rey Obrero
    check if the textbox  "txtdbVersionN" is bound to a field in a table, make the textbox Unbound.

    Author Comment

    Sorry.  DMax DID work.  I just types it wrong.  Thanks as always.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    745 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

    18 Experts available now in Live!

    Get 1:1 Help Now