Or remove the double quote before [amend]='-1'" Also, form![FormName]![ControlName] should be forms![FormName]! [ControlName]
Also, you can't get directly to a subform through the forms collection. Instead, use this: Form!ParentForm!SubFormName.Form!ControlName (This assumes that the subform is in a subform control with the same name as the subform itself, which is the default.) Good luck, Peter Hoogenboom --- In [email protected], "Arman Balin" <[EMAIL PROTECTED]> wrote: > > Try adding a space + a double quote + an ampersand right after your AND > operator. > > On 1/5/07, Oluwatope Oyewamide <[EMAIL PROTECTED]> wrote: > > > > I get a syntax error with the DCount statement. I dont know whats > > wrong with it. > > > > dim x as integer > > > > x = DCount("[ccode]", "docs", "form![Subform1]![ccode]='" & form! [C1]! > > [Text15]& "' AND "[amend]='-1'") > > > > > > > > > [Non-text portions of this message have been removed] >
