Hello there,
I am attempting to design a survey questionnaire in Access 2010, and this is the first time I've used Access in several years. My SQL is rusty, and my VBA skills are introductory.
Currently I need to figure out a way to do the following tasks to create an overall function:
1) Select from a set of records in a Subform (with a many-to-one relationship to the Parent form) the person with the most recent date of birth THIS YEAR, i.e. by month and day only where that birthday < current date
2) Do this only if two other conditions are met: a) person was born in another country; and b) person is >=18;
And 3) Insert that person's name into a table so that the name can be pulled into a field on a subsequent form related to the same Parent record
Each record has a unique "File" number that serves as the primary key, and in the subform there is a "Member" number that serves as the primary key, so "File.Member" is the relationship between the two.
See pseudo-code below for crude example:
while FILE=x;
for HHMEMNO 1 to N (where N=total number of household members);
if (FBORN=1 & AGE>=18) . . .
generate time[n]=time between survey month/day and birth month/day,
select member in household with
smallest value for time, and insert his/her NAME in Access field in
subsequent screen.
x=x+1;
I would appreciate any assistance that may be offered!
I am attempting to design a survey questionnaire in Access 2010, and this is the first time I've used Access in several years. My SQL is rusty, and my VBA skills are introductory.
Currently I need to figure out a way to do the following tasks to create an overall function:
1) Select from a set of records in a Subform (with a many-to-one relationship to the Parent form) the person with the most recent date of birth THIS YEAR, i.e. by month and day only where that birthday < current date
2) Do this only if two other conditions are met: a) person was born in another country; and b) person is >=18;
And 3) Insert that person's name into a table so that the name can be pulled into a field on a subsequent form related to the same Parent record
Each record has a unique "File" number that serves as the primary key, and in the subform there is a "Member" number that serves as the primary key, so "File.Member" is the relationship between the two.
See pseudo-code below for crude example:
while FILE=x;
for HHMEMNO 1 to N (where N=total number of household members);
if (FBORN=1 & AGE>=18) . . .
generate time[n]=time between survey month/day and birth month/day,
select member in household with
smallest value for time, and insert his/her NAME in Access field in
subsequent screen.
x=x+1;
I would appreciate any assistance that may be offered!