click to update

S

sheryl

I have a "minor" problem I would like to fix. WHen I change the Permit Number
in my form I then go to the next field to "check" that it is changed. I
would like it to automatically do that. That way, If I forget to click the
box then I dont get errors later when I print out a report saying that
particular company did not renew their permit. I know there must be a update
query or something I can do. Or code. I am familiar somewhat with code. This
particular problem is like updating an invoice so the person does not get a
late notice. Make sense? Thanks so much for any and all help!!!
 
L

Larry Daugherty

Hi Sheryl,

The good news is "Yes, you can"; in the AfterUpdate event for the textbox
put the line:

me!MyCheckbox=True

The bad news is that if you make a change in error, then catch and correct
it; the box will still get checked. There are a few ways the box can
revert to its prior state: you can select it and click the mouse or hit the
space bar, you could press the Escape key once, If you have really
unsophisticated users you might include a command button on your form with
the caption "Cancel Changes". In the OnClick event of that command button
put the line:

Me.Undo

HTH
 
S

sheryl

I wish that would have worked...But it did not.
I input what you said and i get errors. I have two fields in this form.
FIrst field is called "Permit Number", (I input a number) Next is the check
box called Permit Renewed. I space or click when the permit number is filled
in and that makes the permit current.
I put the code me!Permit renewed=True (afterupdate event)
DId I do it wrong?
 
J

John Vinson

I put the code me!Permit renewed=True (afterupdate event)
DId I do it wrong?

Yes. What you need to do is put

[Event Procedure]

(with the brackets) in the AfterUpdate event line, or (equivalently)
doubleclick the line; click the ... icon and select Code Builder if
Access doesn't put you into the VBA editor automatically. Access will
give you the Sub and End Sub lines; you will need to put

Me![Permit Renewed] = True

in between the two automatically provided lines.

Note that the brackets are essential, since you have a blank in your
control name; without the brackets, Access things that Me!Permit is
the name of your control, and has no idea what to do with the separate
word "Renewed".

John W. Vinson[MVP]
 
Top