PDA

View Full Version : Solved: Dcount / Parameter Query



dondark
06-06-2007, 06:57 AM
Hey,

I have a paramter query that I am viewing in a form. The paramter query obtains the value from a previously opened form (i.e. paramter = [forms]![textbox value]).

I want to count the total number of records that the query pulls up, and also count the total number of records that meet specifc criteria (i.e. field A = X). I know dcount can do this normally, but I have read everywhere it does not work with parameter queries.

Any advice on how to do this?

upendra_agni
06-06-2007, 09:36 PM
No. Dcount doesnt work with parameter queries. Instead you can use DCOUNT with multiple parameters that you require. Like
intX = DCount("[ShippedDate]", "Orders", "[ShipCountry] = '" _ &
Forms!Orders![ShipCountry] & "'AND [ShippedDate] > #1-1-95#")Sub HelpPopup (sFile, sID)Call InitConstants() On Error Resume Nextr=oua.HelpPopup(sFile,sID)If Err0 Then Msgbox L_SECURITY_MSG,48,L_TITLEEnd Sub

Edited 8-Jun-07 by geekgirlau. Reason: insert line breaks