2 things you seem to have misunderstood:
Me.type.AfterUpdate is not the value of the textbox Type, after it is updated. Me.type.AfterUpdate is a PROPERTY, the same property that you can see specified in the Events TAB of your control. In your case it might read [EVENT PROCEDURE]
Second you make a comparison:
- Me.type.AfterUpdate = 6 Or 7 Or 8
Which should further to the above have looked:
or
- Me.type.Value= 6 Or 7 Or 8
The
.Value
is not necessary as
.Value
is the default property of the control.
Not quite done yet. Another (common) misunderstanding is that your code will compare Me.type to 6, 7 and 8. What really is happening is that you are comparing Me.type to 6, and then using the or operator between your comparision (which will be true or false) and 7 and 8. For the program it would look like this:
- TRUE or 7 or 8
-
FALSE or 7 or 8
To make the correct comparision that I believe you are after you should use:
- Me.type = 6 Or Me.type = 7 Or Me.type = 8
or of course the code that NeoPa have provided for you.