AfterUpdate cbo box from query based on other field

H

Hugh self taught

Hi Everyone,

I have a basic form for data entry /update of Competitors. I now want to set
the default value of a cbo box "Age Group" when I have updated the value in
the Date of Birth field. I already have the following query for another
purpose elsewhere that I should be able to use but I can't get the correct
syntax in my head. Can you assist pse...

SELECT Competitors.Competitor_Idx, Competitors.First_Name & " " &
Competitors.Surname AS Name, Competitors.Date_of_Birth, [Age Group].[Age
Group], [Age Group].MaxAge, [Age Group].MinAge,
DateDiff("yyyy",[Date_of_Birth],Now())+Int(Format(Now(),"mmdd")<Format([Date_of_Birth],"mmdd")) AS CurrAge
FROM Competitors, [Age Group]
WHERE
(((DateDiff("yyyy",[Date_of_Birth],Now())+Int(Format(Now(),"mmdd")<Format([Date_of_Birth],"mmdd"))) Between [MinAge] And [MaxAge]));
 
H

Hugh self taught

Turned out to as simple as this

Forms![frmCompetitors]!Age_grp = _
DLookup("AgeGrpIdx", "[qryAgeGroup]")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top