Results 1 to 3 of 3
  1. #1
    bisqeet is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    2

    using queries/vba or just native access code in the source control field

    Hi I'm having a few problems with the correct syntax for one or another functions.

    basically the db is reading training data in from a logcard, cleaning up the data and writing statistics based on that logbook to a form.

    one of the fields provided that statistic for the fastest 5km rowing time

    Code:
    =DomMin("TrgDuration";"tab_logcard";"TrgDistance = 5000")
    now the problem comes when i try to return the date for the same value:

    The SQL for that could work as

    Code:
    SELECT tab_Logcard.TrgDate
    FROM tab_Logcard
    WHERE (((tab_Logcard.TrgDuration)=DMin("TrgDuration","tab_logcard","TrgDistance =5000")));

    I thought that would translate as:
    Code:
    dlookup(trgDate; tab_LogCard;DomMin("TrgDuration";"tab_logcard";"TrgDistance = 5000"))

    but its just returning a #NAME msg.

    is the criteria too complex
    what would be another solution ?

    note:


    german syntax changes dmin/dommin

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    Nomally, the sql usage is: MIN(field)
    not DMIN. (nor German DOMMIN)

    In query design, Just choose the item in the grid field for Totals, you cant pick the wrong one, unless you type it in manually.

  3. #3
    bisqeet is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    2
    thanks, but it didnt help me.
    Min, Max don't allow for compley where clause.

    the dmin allows me to be more accurat with my where clause:

    DMin("<Field Name>", "<Table Name>", "<Where Clause>")

    i'm not sure why i would want to pick a total - i want the date where the fastest time was recorded.



    basically

    =DomWert("TrgDate";"tab_logcard";"trgDuration ='xx:yy.z'")

    will give me a specific date back from the time 'xx:yy:zz

    where xx:yy.z = =DomMin("TrgDuration";"tab_logcard";"TrgDistance = 10000")


    as stated the SQL returns the correct value - i just wanted to know how syntax the function correctly in the control source field

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-02-2013, 12:58 PM
  2. My field is not found in Control Source List
    By eemiller1997 in forum Access
    Replies: 6
    Last Post: 10-25-2012, 01:49 PM
  3. Replies: 5
    Last Post: 04-03-2012, 12:08 PM
  4. Textbox Control Source As Field Input
    By Jester0001 in forum Forms
    Replies: 4
    Last Post: 03-02-2012, 10:50 AM
  5. Replies: 1
    Last Post: 04-29-2010, 05:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums