Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2012
    Posts
    68

    Unanswered: Me.txtstartdate = "value from table"

    I'm trying to insert a value from a table into an unbound txt box on my form.

    From table "transfer date"
    To Me.txtstartdate

    I was trying to use
    Me.txtstartdate = blah blah blah

    But I can't figure out what expression to use.

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    The DLookup() function is used for this kind of thing.

    Me.texstartdate = DLookup("Field to be inserted", "Table or Query", Criteria)

    Linq ;0)>
    Last edited by Missinglinq; 09-29-14 at 19:13.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Mar 2012
    Posts
    68
    I was thinking the same. Think I could use the Dmax function as criteria?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    its a domain function, its similar to dlookup, so yes it can be used. assuming that you want the maximum date value for a specified subset of the table/query. just as any of the other domain functions could be used
    Domain Aggregate Functions | Microsoft Office Access 2007 VBA: Using Built-In Functions | Que
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by bsigmon1103 View Post

    ...Think I could use the Dmax function as criteria?
    If you want the 'maximum date' you can simply use DMax instead of using it as the criteria for DLookup!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Mar 2012
    Posts
    68
    I did!!!! Thanks Linq. Got it working

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Good luck with your project!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •