I am looking to prevent a form closing and pop up an error message if one or more fields in a related form isnull.
I have a Main Form called "Job". In this main form is a subform called "JobTask" which is a continuous form. It contains a look-up box listing all the possible Tasks I could have for this job. Let's say I choose two (Task 1 and Task 2).
Within the subform the next field for each Task record is a check box (Choose a subtask). This checkbox opens another form "JobSubTask " which allows me to choose which SubTasks apply to the selected task (they can be different for each JOB). (For reference the TaskID is passed to the Form "JobSubTask " and so linking the Subtask to the Task)
At present it is possible to close the form "Job" without actually selecting the SubTasks for each Task. I wish to stop that.
I have been looking at code like that shown below:
[if nz(SubTaskID,"" )="" Then go to missing]
However, I do not know, how to do this when the fields are on anotehr form.
Of course what I really need is to ensure that for EVERY Task selected, there is at least one SubTask selected.
Thanks
I have a Main Form called "Job". In this main form is a subform called "JobTask" which is a continuous form. It contains a look-up box listing all the possible Tasks I could have for this job. Let's say I choose two (Task 1 and Task 2).
Within the subform the next field for each Task record is a check box (Choose a subtask). This checkbox opens another form "JobSubTask " which allows me to choose which SubTasks apply to the selected task (they can be different for each JOB). (For reference the TaskID is passed to the Form "JobSubTask " and so linking the Subtask to the Task)
At present it is possible to close the form "Job" without actually selecting the SubTasks for each Task. I wish to stop that.
I have been looking at code like that shown below:
[if nz(SubTaskID,"" )="" Then go to missing]
However, I do not know, how to do this when the fields are on anotehr form.
Of course what I really need is to ensure that for EVERY Task selected, there is at least one SubTask selected.
Thanks
Comment