Refresh Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When a user goes to a form (Inventory) to enter a new record, I force the
user to have to click on a command button (ADD RECORD). When the user clicks
on the button, I have events firing that will automatically insert:

Fields:

EnteredBy: [Looks to see who is logged onto the program and inserts name]
DataEntryDate: [Inserts todays date]
DateReceived: [Inserts todays date as a default but can change it]. The
focus is then set to the DateReceived field.

I have noticed that when a date is automatically inserted, it does not
respond to the AfterUpdate event if the user enters the field and leaves the
field without making any changes.

Is there a way to have the field refresh (not the entire record just the
field - Note: I tried Me.Refresh on the ENTER event and it did not work) so
that the AfterUpdate event code runs?

Thanks in advance for any assistance...

Rick
 
When a user goes to a form (Inventory) to enter a new record, I force the
user to have to click on a command button (ADD RECORD). When the user clicks
on the button, I have events firing that will automatically insert:

Fields:

EnteredBy: [Looks to see who is logged onto the program and inserts name]
DataEntryDate: [Inserts todays date]
DateReceived: [Inserts todays date as a default but can change it]. The
focus is then set to the DateReceived field.

I have noticed that when a date is automatically inserted, it does not
respond to the AfterUpdate event if the user enters the field and leaves the
field without making any changes.

Is there a way to have the field refresh (not the entire record just the
field - Note: I tried Me.Refresh on the ENTER event and it did not work) so
that the AfterUpdate event code runs?

Thanks in advance for any assistance...

Rick

I'm not an Access expert, and I don't know what code you are trying to
run, but you might could try copying the code that you have in the
AfterUpdate event to the On Exit Event. That way, before the focus
has left the field your procedure should run (unless they move the
focus to a different form or window). Unless the user changes the
data in the control or makes a selection in a combo or list box the
After Update Event will not occur.

You could also add a Message Box to the On Enter or On Got Focus Event
that requres them to make a selection which will activate code to
trigger the AfterUpdate event.

Hunter57
http://churchmanagementsoftware.googlepages.com/home
 
Back
Top