Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    34

    Question Unanswered: counting duplicate values in a field in a textbox

    Hi everybody

    Well it's been a while since I've done anything in MS Access but I thought I'd give it a go.

    I've been creating a simple database but have run into a bit of a brick wall.

    I have created a form which needs to search a table to find duplicates and input the number found into a textbox.

    Simple I can hear everybody saying but I can't find out the best way to achieve this. I want to keep the database as quick as possible.

    I've managed to get a query to work it out. Here is the SQL code:

    SELECT First(AltDelAdd.BillingID) AS FirstOfBillingID, Count(AltDelAdd.BillingID) AS NumberOfDups
    FROM AltDelAdd
    HAVING (((First(AltDelAdd.BillingID))=[Forms]![Edit Cust]![Cust No]));

    Can anybody help?

    Thanks

    Nick

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The simplest would be:

    =DCount("*", "AltDelAdd", "BillingID = " & [Forms]![Edit Cust]![Cust No])
    Paul

  3. #3
    Join Date
    Jun 2007
    Posts
    34
    Hi guys, right I've managed to figure out how to do this using a SubForm.

    Is there any way to stop users being able to select the text it generates and scrolling within the subform? I just want the text to appear without it being possible to highlight it within the subform.

    Thanks

    Nick

  4. #4
    Join Date
    Jun 2007
    Posts
    34
    sorted that too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •