Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting an Error message with the DCount Function!!!

Status
Not open for further replies.

Kckronic21

Programmer
Jul 29, 2001
81
US
I have a problem with my report header. I have set up the following criteria in my query where the Position field critieria states this: =[Forms]![Permanent_Employees_Center_and_Position_Form]![CenterNametxtbox] and the Position field states this:=[Forms]![Permanent_Employees_Center_and_Position_Form]![PositionNametxtbox] I have created both the CenterNametxtbox and the PositionNametxtbox in the Permanent_Employees_Center_and_Position_Form. My problem is I want to place a textbox in the report header that list the Center Name and also list the Position Name, but the what I also want to do is put an “s” at the end of the Position Name if there are more than one person that goes to that Center and has the same Position. For example: I have 5 people that go to a Center called West Ashley and they are all Teachers, so I want the report header to look like this: “West Ashley Teachers”. I have tried to use the DCount function, but I keep getting an error message. This is what I have been putting in for the control source of my textbox in the report header: =IIf(DCount("*","Permanent_Employees_Center_and_Position_Query")>1,[Forms]![Permanent_Employees_Center_and_Position_Form]![CenterNametxtbox] & " " & [Forms]![Permanent_Employees_Center_and_Position_Form]![PositionNametxtbox] & "s”,[Forms]![Permanent_Employees_Center_and_Position_Form]![CenterNametxtbox] & " " & [Forms]![Permanent_Employees_Center_and_Position_Form]![PositionNametxtbox]) Please tell me what I am doing wrong. Thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top