Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

DCount in Text box from a parameter query

Discussion in 'Information Technology' started by PD, Jul 28, 2006.

  1. PD

    PD
    Expand Collapse
    Guest

    I set up a report using a simple query as the control source. I used text
    boxes with a DCount expression and it worked. I then added a parameter to
    the query ie.[Enter Account Number], the query returns the correct
    information but my Report text boxes (with DCount expressions) all say error?
    --
    PRD
     
  2. Loading...

    Similar Threads Forum Date
    Malaysia Hindus, Sikhs In Malaysia Appalled With University Textbook Ridiculing Their Faiths Breaking News Jun 14, 2016
    Hard Talk Taking One Liners Out Of Context From Gurbani To Allow Intellectual Independence? Hard Talk Apr 23, 2016
    India Protests in India Over the Desecration of a Holy Text Leave Two Dead Breaking News Oct 16, 2015
    Learn Punjabi Convert Punjabi text Language, Arts & Culture Oct 11, 2013
    Sikh Coalition Harmeet Kaur Took the Lead ! First to Respond to Textbook Challenge ! Sikh Organisations May 25, 2013

  3. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    PD,

    What are the DCount expressions?

    --
    Steve Schapel, Microsoft Access MVP

    PD wrote:
    > I set up a report using a simple query as the control source. I used text
    > boxes with a DCount expression and it worked. I then added a parameter to
    > the query ie.[Enter Account Number], the query returns the correct
    > information but my Report text boxes (with DCount expressions) all say error?
     
  4. PD

    PD
    Expand Collapse
    Guest

    =DCount("[Cal]","Query for Inspection Type Report","[Cal] = 'Dec'")
    --
    PRD


    "Steve Schapel" wrote:

    > PD,
    >
    > What are the DCount expressions?
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > PD wrote:
    > > I set up a report using a simple query as the control source. I used text
    > > boxes with a DCount expression and it worked. I then added a parameter to
    > > the query ie.[Enter Account Number], the query returns the correct
    > > information but my Report text boxes (with DCount expressions) all say error?

    >
     
  5. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    PD,

    Thanks. Ok, is "Query for Inspection Type Report" the name of the query
    that the report is based on? If so, it makes sense that Access can't
    evaluate the DCount if there is an unevaluated Parameter.

    One approach would be to forget the Parameter Query idea altogether, and
    instead put an unbound terxtbox on a form which the user can use to
    enter the Account Number. Then, in the query, replace the parameter
    prompt with a reference to the textbox, using syntax such as...
    [Forms]![NameOfForm]![NameOfTextbox]

    In fact, I would recommmend doing this in any case.

    Then, you could further simplify by changing the expression for your Dec
    textbox to like this...
    =-Sum([Cal]='Dec')

    --
    Steve Schapel, Microsoft Access MVP

    PD wrote:
    > =DCount("[Cal]","Query for Inspection Type Report","[Cal] = 'Dec'")
     
  6. PD

    PD
    Expand Collapse
    Guest

    Ah ha!
    Perfect and thank you very much.
    --
    PRD


    "Steve Schapel" wrote:

    > PD,
    >
    > Thanks. Ok, is "Query for Inspection Type Report" the name of the query
    > that the report is based on? If so, it makes sense that Access can't
    > evaluate the DCount if there is an unevaluated Parameter.
    >
    > One approach would be to forget the Parameter Query idea altogether, and
    > instead put an unbound terxtbox on a form which the user can use to
    > enter the Account Number. Then, in the query, replace the parameter
    > prompt with a reference to the textbox, using syntax such as...
    > [Forms]![NameOfForm]![NameOfTextbox]
    >
    > In fact, I would recommmend doing this in any case.
    >
    > Then, you could further simplify by changing the expression for your Dec
    > textbox to like this...
    > =-Sum([Cal]='Dec')
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > PD wrote:
    > > =DCount("[Cal]","Query for Inspection Type Report","[Cal] = 'Dec'")

    >
     

Share This Page