It feels to me as though I need something like
DCount(myfield,mytable) & (myotherfield,myothertable) does that work like
No.
DCount takes three operands: the field you want to count (use "*" if you want
to count all records); the name of the table or query within which those
records exist; and a text string which evaluates to the WHERE clause of a
Query identifying which items you want.
I can't see your database, and I don't know the structure of your table, and I
can't see your form (hint: nobody else here can either unless you post them),
but I'm guessing that you want
=DCount("*", "myTable", "[myDate] = #" & [Forms]![MyMainForm]![myDateControl]
& "# AND MyAddress = '" &
[Forms]![MyMainForm]![Subformcontrolname].Form![Textboxname] & "'")
This would all be ONE LINE - it's a single function call, not three separate
statements. You can break up the line for readability by putting a blank
followed by an underscore at the end of a (partial) line - don't do so in the
middle of a string constant though.
I'm assuming (again, in the absence of any information) that you have a form
named MyMainForm with a textbox myDateControl that you want to use as a date
criterion; a Subform control on that mainform named Subformcontrolname; and
that the form within that subform has a control named Textboxname containing
the address. I'm also assuming that the table myTable contains a date field
named mydate and also a text field name MyAddress and that you want to find
how many records match on both criteria.
Why you should have both the date and address in the same table, but ALSO
apparently have them in two separate tables (the form and subform's
recordsource) I do not know, but that's the situation as I've been able to
piece it together from your somewhat confusing posts. If you can clarify my
misunderstandings I'll be glad to try to help.