Results 1 to 5 of 5
  1. #1
    RossPart is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2024
    Posts
    1

    Question #Name?

    I have a table - tblVoucher which is like a 'Header' table. It has a field called VID (VoucherId) which is an Autonumber Type
    I have a table - tblTransactionDetail which contains many lines related to the tblVoucher table via VID which is a number type and LID (LineId), an Autonumber type, and a field called Total which is currency type.
    There is a relationship which Links the two VID fields from each table.



    PROBLEM:
    subformTransactioDetail (part of frmVoucher) lists Line Items by [LID] for each [VID]. on frmVoucher. I have a field on frmVoucher called 'VoucherTotal' which = DSUM(("Total","tblTransactionDetail","VID= " & me.VID.

    The result in VoucherTotal is "#Name?"

    I think I'm 95% there, but cannot see the problem.

    PLEASE HELP

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Me. alias can be used only in VBA, not in textbox.

    However, as linked thread posted by Bob indicates, should be able to do this simple sum on form without domain aggregate function.

    Is subform in datasheet view? If not, could just show sum in subform header or footer section.

    Is Total storing a calculated result?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Is this the whole statement? The end of the statement is missing some: DSUM(("Total","tblTransactionDetail","VID= " & me.VID.

    Try taking off the Where part to see if it works:
    DSUM("Total","tblTransactionDetail")

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    When you get the syntax correct, use the field and not the control.

    Text19 is as below, though nothing is shown until I give Text19 focus?

    Code:
    =DLookUp("Steps","tblDates","StepsID = " & [stepsID])
    Attached Thumbnails Attached Thumbnails Expression.JPG  
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Tags for this Thread

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