Changing Field Data in a Form Control

  • Thread starter Thread starter Unclebuck
  • Start date Start date
U

Unclebuck

I have an Instructor Database form that tracks the status of instructors from
the time they apply for the position [Title] "Applicant" through an
apprenticeship program "Apprentice" and finally upon certification they are
titled as an "Instructor". I need the code in the form so that when a record
is first entered the [Title] automatically enters "Applicant" providing
[DateTrained] & [DateInstructorCertified] are Null. Then when the "Applicant"
receives initial training [DateTrained] and [DateInstructorCertified] Is Null
the [Tiltle] is automatically changed to "Apprentice".
 
I have an Instructor Database form that tracks the status of instructors from
the time they apply for the position [Title] "Applicant" through an
apprenticeship program "Apprentice" and finally upon certification they are
titled as an "Instructor". I need the code in the form so that when a record
is first entered the [Title] automatically enters "Applicant" providing
[DateTrained] & [DateInstructorCertified] are Null. Then when the "Applicant"
receives initial training [DateTrained] and [DateInstructorCertified] Is Null
the [Tiltle] is automatically changed to "Apprentice".

Check the controls in their afterupdate event.
If they're both true, set the value of Title to Apprentice.
 
You don't need to have a field for that. You can have a calculated field in
queries or a calculated text control in forms or reports. The "Control
Source" property of a text control in a form or report should be something
like:

=IIf(IsNull([DateTrained]) And
IsNull([DateInstructorCertified]),"Applicant",IIf(IsNull([DateInstructorCertified]),"Apprentice","Instructor"))
 
Thank You for the code & response it was very helpfull. as you advised I
created a query & put the code in a calculated field. I would like to expand
this code to include "Master Instructor" based on a
[DateMasterInstructorCertified] Field, "County Coordinator" based on a
[DateCountyCoordinatorCertified] field & "Regional Coordinator" based on a
[DateRegionalCoordinatorCertified] field. (I may need to add one more title
similar to the above at a later date.) I tried to modify the code but I could
not obtain the desired result.
 
Back
Top