Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2013

    Unanswered: access computed field behaves differently in runtime

    I am using access 2010

    I have an unbound textbox whose value is computed as the sum of a cross query column.

    I need to check the value of this field in vba code to compute the value of some other fields.

    In access 2010 it works perfectly while when I distribute it on some other computers(using the runtime), it fails.
    The field value is always 0 before I run the vba code, so wile the value is then correct (the form do actually display the real sum), the vba code runs with an erroneous value of 0
    I have tried to put a Me.txt_totaltime.Requery before running the vba code, but here again while it works in acess 2010, it fails in the runtime environement, where my form does not even open anymore without any errors what so ever (the runtime computer is very slow, could it be it?)

    I have tried many thing, but none of my attemps have been successfull, and I have not found any similar issue on the web

    Thank you for your help

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    I would use a domain function to compute the value:
    Me.txt_totaltime=DSum("txt_dailytime", "TableName", "Condition")
    Have a nice day!

  3. #3
    Join Date
    Aug 2013
    Hi thanks for the help.
    I tried the Dsum function but it does not seem to work on cross query.
    I am sorry I did not explain everything.
    Indeed the text box [txt_dailytime] is actually [txt_dailytime_01] with the 2 ending digit representing the day.
    The cross query tab outputs a table with a column for every day of the month.
    When I try a Dsum using the column headings, it does not work

    Dim index As string
    for i = 1 to 31
    if i<10 Then
    index = "0" & i
    index = i
    End If Set ctlDailytime=Me.Controls("txt_dailytime_" & index) ctlDailytime=Dsum(index, Xqueryname)
    Last edited by babarnc; 09-17-13 at 04:38.

Posting Permissions

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