Fazer uma PerguntaFazer uma Pergunta
 

RespondidoDSum Errors On Some Machines

  • terça-feira, 7 de julho de 2009 23:49Fogie Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
         I have a form which uses many DSum calls.  This form works fine on my machine (XP Home, Access 2003), and on my test machine (Win. 2000, Office 2000) but gives only #Error on another machine (XP Pro, Access 2000).  The .mdb file was copied directly to the offending machine, so all data, table structure and code are the same.

        Any ideas on where I should look to find out why?
    The early worm gets the bird

Respostas

  • quinta-feira, 9 de julho de 2009 5:18BrijrajRathod Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    use below code,

    use nz to avoid headache of null value.

    IIf(DSum("nz( [Admin Cost],0 )","[Temporary Expenditures Table]","Month(nz( [E Date],0) )=10")>0,DSum("nz( [Admin Cost],0) ","[Temporary Expenditures Table]","Month(nz( [E Date],0) )=10"),0)
    Rgrds, Brij http://accessvbadeveloper.wordpress.com

Todas as Respostas

  • quarta-feira, 8 de julho de 2009 11:16BrijrajRathod Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi,

    Please provide some more information about your code using DSum and #Error. Thanks

    Rgrds, Brij http://accessvbadeveloper.wordpress.com
  • quarta-feira, 8 de julho de 2009 14:30Fogie Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Ok - thanks for answering.

    The form is 7 X 12 textboxes.  The code from one of the boxes is:

    =IIf(DSum("[Admin Cost]","[Temporary Expenditures Table]","Month([E Date])=10")>0,DSum("[Admin Cost]","[Temporary Expenditures Table]","Month([E Date])=10"),0)

    When the form is run on the customer's machine all that appears in any of the boxes is "#Error".  The customer's machine is running Access 2000 with Windows XP Pro and the .mdb file is on a server with the offending machine linked to it.  Other forms worked, so I don't think it is a connection issue.

    The table does have nulls in it, but the code ignores the nulls on the two test machines.

    The early worm gets the bird
  • quinta-feira, 9 de julho de 2009 5:18BrijrajRathod Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    use below code,

    use nz to avoid headache of null value.

    IIf(DSum("nz( [Admin Cost],0 )","[Temporary Expenditures Table]","Month(nz( [E Date],0) )=10")>0,DSum("nz( [Admin Cost],0) ","[Temporary Expenditures Table]","Month(nz( [E Date],0) )=10"),0)
    Rgrds, Brij http://accessvbadeveloper.wordpress.com
  • quinta-feira, 9 de julho de 2009 14:58Fogie Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    I had not heard of the nz function, but that might be it.  I will try it.  Thanks.
    The early worm gets the bird