Search results

  1. R

    Set limit on number of records that can have a particular field value

    Update: I was able to change my database design and get the same functionality I wanted. SELECT Universities.Country, (Sum([Application Cost (AED)] + Constants.[Cntr Application Cost (AED)] ) ) AS Tot FROM Universities, Constants WHERE Universities.Country = Constants.Country AND...
  2. R

    Set limit on number of records that can have a particular field value

    UPDATE: I wrote some SQL code but I keep getting an error SELECT Country, ( Sum([Application cost (AED)]) - SELECT Sum([Application cost (AED)]) FROM Universities WHERE Apply = TRUE AND Centralized =...
  3. R

    Set limit on number of records that can have a particular field value

    I'm not sure if this should go in a new thread. I need to ask another question. I want to do a quarry that makes a calculation based on my Universities table. The calculation should: • Use only the records that have Apply = True • Subtotal by Country value • Subtotal =...
  4. R

    Set limit on number of records that can have a particular field value

    Thank you very much. This is what I need. I am going to pick up a book and attempt to learn some SQL. I think I will need it for the next task.
  5. R

    Set limit on number of records that can have a particular field value

    This is wonderful. Thanks. Now I need to replace the 5 with the cntr_limit field value stored in another table (called Constants) that corresponds to the same country. Should I use something like: SELECT Constants.Country AS Expr1 FROM Constantsnot sure what I should do for the country.
  6. R

    Set limit on number of records that can have a particular field value

    Ok, now it ran. But when I go to my table, it doesn't let me make changes or save it. Gives me an error every time. I tried deleting the query but that didn't stop it. I don't have a key field in that table, btw.
  7. R

    Set limit on number of records that can have a particular field value

    I modified your code to: ALTER TABLE Universities ADD CONSTRAINT Cent_limit CHECK ( NOT EXISTS ( SELECT Universities.Country, Count(Universities.ID) AS CountOfID FROM Universities...
  8. R

    Set limit on number of records that can have a particular field value

    Should I put the code in VBA editor? I changed to ANSI 92 in Access options, but I'm getting syntax errors with the code.
  9. R

    Set limit on number of records that can have a particular field value

    I wanted to make sure that each country available does not violate the rule ( number of records where both Centralized = True And Apply = True). I'm not sure who to do this by adding another AND. If I can find out which record is modified in the table, then I can get the Country value (with...
  10. R

    Set limit on number of records that can have a particular field value

    Thanks for the info. I am now attempting to write the code. This is what I have so far: Option Compare Database Option Explicit Sub MyCodeRoutine() Dim count As Integer count = DCount("*", "Universities", "Centralized = True And Apply = True") MsgBox count End Sub I...
  11. R

    Set limit on number of records that can have a particular field value

    Ok. Can't I apply the validation to the table instead of the form. I made a form for another table before so I have to learn VBA next. What about a macro? I tried this in a macro: if Count([Universities]![Country] & [Universities]![Centralized]=True &...
  12. R

    Set limit on number of records that can have a particular field value

    sure. I made the edits to my post.
  13. R

    Set limit on number of records that can have a particular field value

    I need help building a validation expression that concerns four of my fields: The number of records that have the same country, AND Centr=TRUE, AND Apply=TRUE, should not exceed the Centr limit value. I am a complete beginner and designing my first data base. Therefore i would appreciate the...
Back
Top Bottom