I'm a bit confused here, Céline. If 'Member' is the name of the first field,
then what is 'NoMember'? Likewise if 'S' is the name of the second field,
then what is 'Service'?
I can not see any reason why the code you posted would fail, provided that
a) Member is an editable control on the form, b) S is a field in the form's
record source or a control bound to a field in the form's record source and
c) the field is of a data type capable of accepting the value -1, which a
Jet Yes/No field certainly can.
For example ...
I create a table in an MDB, with two fields, 'Member', a Long Integer, and
'S', a Yes/No field. (I'm assuming that 'Member' is a number because of your
reference to a number between 899 and 1000). I used the AutoForm wizard to
create a form bound to this table, with a text box named 'Member' bound to
the 'Member' field, and a check box named 'S' bound to the 'S' field. I add
the code you posted to the AfterUpdate event procedure of the text box
'Member'
Private Sub Member_AfterUpdate()
Me.S = -1
End Sub
As soon as I edit the contents of the text box 'Member' and press the Enter
or Tab keys, the check box is checked.
If you can identify what is different between this scenario and your
scenario, that will probably reveal where the problem lies.
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.