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...
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 =...
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 =...
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.
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.
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...
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...
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...
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 &...
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...