View Single Post
  #5  
Old May 18th, 2010, 05:32 PM posted to microsoft.public.access.forms
Mommybear
external usenet poster
 
Posts: 37
Default How to run event on other options

I have a database that has about 39 fields in it. Only about 20 of them are
actually entered. The others are either a default value, or a value based on
what is entered in specific fields such as:
box a = contractor box b =vendor, value stored = 1
box a = contractor box b = contractor, value stored = 2
This database consists of 30k records therefore, I can not change the way it
works, only make it simple to add to.
I figured out that all I needed to do was to add a Call to the on exit
event. This works wonderfully for what I need. Thank you.


"John W. Vinson" wrote:

On Tue, 18 May 2010 06:36:01 -0700, Mommybear
wrote:

The fields in the form are bound, however, I have other fields that are not
on the form that default to a value, are calculated, being formatted to write
all caps, or go thru an if statement to determine value that are being
populated thru this Event procedure. The save button works great, however, I
don't know what is best in terms of handling the autosave when you tab or
enter past the last field on the screen. Do I duplicate the code or is there
a command that I could use to force this thru the save button code.


I'm not absolutely sure what is going on here - it sounds like you're
(unwisely) storing derived or calculated data?

In any case, the Form's BeforeUpdate event fires whenever and however it
completes a record and starts to write it to disk. You might want to move your
code from the button event to the BeforeUpdate event (which will be triggered
when your Save button does its thing).
--

John W. Vinson [MVP]
.