Need help in restricting data input

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

New at Access

I have 2 Access forms. One is a parent and the other a child. I am trying
to control a particular data entry into one of the columns in the child
table. What I need to do is when a client enters data into the child form a
restriction needs to be done. This restriction will have to use the primary
key of the child form and refernece the parent form to find out the type of
position the employee (from the child form) has (ie mngr, sales, tech etc).
That data will decide the rule allowable range number that the restriction
in the child form needs to apply. ie if the employee in the child form is
found to be a mngr I want the restriction in the child entry form to enforce
that an entry for position number in the child form has to be within the
range of 0 to 3 and for sales the restriction range has to be 0 to 2 and for
the tech the restriction is the range 0 to 1. If an entry is made in the
child form in that column outside the allowable range I want an error stmt
to pop up telling me that the number exceeds his position. Hoping this is
not to involved. BTW there are about 7 types of position.

Hope I made myself clear

Thank you in advance,

Les
 
It sounds like the fields are all in the subform. Use the On Current and the
PositionType After Update event to set the ValidationRule property of the
Position field to your ranges. Ideally you would have a field(s) in your
PositionType table that would have these values.
 
Back
Top