"Chey" wrote
can you limit how many records for a specific number
For example. We use Travel Authorization numbers. I
want to only allow 2 Agent fees per TA Number.
Write a "key generator" to generate the AgentFeeID, starting with 1, and set
the Validation for the AgentFeeID in the Table to <3. Key your Agent Fee
Records on the combination of TA and AgentFeeID. Here's the vital code,
assuming the Agent Fee table is "tblAgentFee" and the TA number is displayed
in the current form in a Control named "txtTA."
strCriteria = "[TA] = " & Me.txtTA
DMAX ("AgentFeeID","tblAgentFee", strCriteria)
Larry Linson
Microsoft Access MVP