DCount function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SheldonMopes@KidNet.com

    DCount function

    I'm having difficulty with the DCount function, not getting the
    results that I want.


    Field1A and Field2A are fields in TableA matching Field1B and Field2B
    in TableB

    Using a calculated control in a subform bound to TableB, Field1B and
    Field2B are on the form. (Control names are txtField1B and txtField2B)


    = DCount("ID", "TableA", "([TableA].[date]=date() AND
    [TableA].[Field2A]=[TableB].[Field1B] AND
    [TableA].[Field2A]=[TableB].[Field2B])")

    I have tried this also using the reference to the controls on the form
    as well, but still no good:

    = DCount("ID", "TableA", "[TableA].[date]=date() AND
    [TableA].[Field1A]=forms!frmSubfo rm1!txtField1B AND
    [TableA].[Field2A]=forms!frmSubfo rm1!txtField2B" )

    What am I doing wrong ? Thanks in advance for any help.


  • Trevor Best

    #2
    Re: DCount function

    SheldonMopes@Ki dNet.com wrote:[color=blue]
    > I'm having difficulty with the DCount function, not getting the
    > results that I want.
    >
    >
    > Field1A and Field2A are fields in TableA matching Field1B and Field2B
    > in TableB
    >
    > Using a calculated control in a subform bound to TableB, Field1B and
    > Field2B are on the form. (Control names are txtField1B and txtField2B)
    >
    >
    > = DCount("ID", "TableA", "([TableA].[date]=date() AND
    > [TableA].[Field2A]=[TableB].[Field1B] AND
    > [TableA].[Field2A]=[TableB].[Field2B])")
    >
    > I have tried this also using the reference to the controls on the form
    > as well, but still no good:
    >
    > = DCount("ID", "TableA", "[TableA].[date]=date() AND
    > [TableA].[Field1A]=forms!frmSubfo rm1!txtField1B AND
    > [TableA].[Field2A]=forms!frmSubfo rm1!txtField2B" )
    >
    > What am I doing wrong ? Thanks in advance for any help.
    >
    >[/color]

    Perhaps your [date] column contains more than just a date? (i.e. the
    time part too).


    --
    [OO=00=OO]

    Comment

    Working...