Results 1 to 5 of 5
  1. #1
    eliotchs is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    24

    ?? on DMAX function

    Hi

    Can anyone let me know why this is stating an ERROR in the textbox when I run the form ?

    I am using this formula as the default

    =DMax("[SEQ]","HillData","[CLINO] =" & [Forms]![EpisodeNotes]![CLINO])

    where Hilldata is the table
    and CLINO is the field on the form EpisodeNotes

    Thanks
    Joe

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Is CLINO text or number?

  3. #3
    eliotchs is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2011
    Posts
    24
    Clino is text on this db where the db I got the formula it was a number

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    It might be because there are no records in HillData for that particular CLINO, and DMax returns Null, which the underlying table doesn't like. Use Nz to return 0 in this case:

    =Nz(DMax("[SEQ]","HillData","[CLINO] =" & [Forms]![EpisodeNotes]![CLINO]), 0)

    John

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I think you'll need these quotes if it is text
    =Nz(DMax("[SEQ]","HillData","[CLINO] ='" & [Forms]![EpisodeNotes]![CLINO]), 0) &"'"

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

Similar Threads

  1. Dmax
    By Jrw76 in forum Forms
    Replies: 6
    Last Post: 01-09-2014, 02:47 PM
  2. DMAX in VBA
    By Meanfish in forum Access
    Replies: 1
    Last Post: 11-03-2012, 11:06 AM
  3. Dmax/Val function Problem
    By MintChipMadness in forum Programming
    Replies: 8
    Last Post: 08-13-2012, 08:50 AM
  4. Replies: 6
    Last Post: 07-24-2012, 03:02 PM
  5. using a qry to run a report with Dmax Function
    By mrjoshuaw in forum Access
    Replies: 6
    Last Post: 02-01-2012, 07:29 AM

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