Triggering AfterUpdate Event

I have a data entry form using forms and multipages with numerous dat
fields for the user to populate. I have also written error handlers t
restrict the input of the user using the AfterUpdate event (e.g. I
they enter an invalid entry for a date field and move off, th
AfterUpdate triggers an error message, which pops up next to th
field). 

The general usage of this is that someone will open a new form, ente
data, and write to a worksheet. Since I do not allow invalid data to b
written, I can ensure that the data is correct when it is written, s
when I open the form, I do not need to validate anything.

However, in some cases, I may want to to import data from anothe
source, in which case, I would need to read in the data and validate. 

However, since the error handlers run off the afterupdate event, usin
a macro to read in the data and populate the fields does not trigge
them. I thought I could bypass this problem by running a second macr
that uses SetFocus for each control to simulate moving off the control
However, this does not work also. 

So after that explanation, my question is how I can trigger th
AfterUpdate events using VBA code

--
Message posted from http://www.ExcelForum.com

0
2/9/2004 6:10:56 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
437 Views

Similar Articles

[PageSpeed] 22

If you're loading a few textboxes(??) with data from somewhere else, I would
think it might be distracting to the user to tell them that what they just
entered isn't correct.

Maybe you could validate it when you're loading the form or maybe you could
validate it in the Ok/Continue button code???



"Ripan <" wrote:
> 
> I have a data entry form using forms and multipages with numerous data
> fields for the user to populate. I have also written error handlers to
> restrict the input of the user using the AfterUpdate event (e.g. If
> they enter an invalid entry for a date field and move off, the
> AfterUpdate triggers an error message, which pops up next to the
> field).
> 
> The general usage of this is that someone will open a new form, enter
> data, and write to a worksheet. Since I do not allow invalid data to be
> written, I can ensure that the data is correct when it is written, so
> when I open the form, I do not need to validate anything.
> 
> However, in some cases, I may want to to import data from another
> source, in which case, I would need to read in the data and validate.
> 
> However, since the error handlers run off the afterupdate event, using
> a macro to read in the data and populate the fields does not trigger
> them. I thought I could bypass this problem by running a second macro
> that uses SetFocus for each control to simulate moving off the control.
> However, this does not work also.
> 
> So after that explanation, my question is how I can trigger the
> AfterUpdate events using VBA code?
> 
> ---
> Message posted from http://www.ExcelForum.com/

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
2/10/2004 1:01:49 AM
Dave,

I agree 100%. That's why the error handlers I developed are in th
spirit of the Visual Studio .NET framework. I basically link an imag
file that sits next to each control which will appear on an error an
has the error message in the ControlTipText field. That way, the error
are unobtrusive but easily identifiable. 

Given that Excel really doesn't have anything like that that I coul
find, it was worth the extra effort to have that working. 

In any case, I found a way to work around triggering the after updat
event. I basically temporary change the value in the control and chang
it back, then move focus to something else. That triggers the event
and pops up any detected errors.

Thanks for your help.

Ripa

--
Message posted from http://www.ExcelForum.com

0
2/10/2004 2:54:27 PM
Reply:

Similar Artilces:

Event of closing a form or navigating away
I need to use some code to update some tables after entering a new record or editing an existing record. I need to know what event I should use. I know after entering a new record, we can navigate away from current record, or the form can be closed. I don't what else can happen to get away from current record. Please give me some suggestions regarding how we should catch these events. Thanks in advance, Guangdew -- Message posted via http://www.accessmonster.com On Fri, 26 Feb 2010 01:10:38 GMT, "guangdew via AccessMonster.com" <u58044@uwe> wrote: &g...

Trigger email
Is there a way that you can have a countdown and when the countdown reaches 0 for it to automaticly send out a email to a certian person? You will first have to determine how you are going to calculate your countdown. Then try the following: Dim strSubject As String Dim strAddress As String Dim strMessage As String Dim blSendEmail as Boolean strSubject = "Countdown reached zero" strMessage = "This is the message that will be the body of the email." If 'This is where you would put the countdown check value' Then ...

Rob...Cost update trigger
I found a post that originally included a cost update trigger that Rob had created. It updates the sales price based on a new cost. I can't get the attachment anymore. Anybody out there have the trigger? Thanks, G E ...

Cancel sheet change event
Is it possible to cancel the sheet change event if the sheet is a chart sheet? Hi, Can to elaborate? A chart sheet does not have a Change event. Do you mean the SeriesChange event? Cheers Andy NSK wrote: > Is it possible to cancel the sheet change event if the sheet is a chart sheet? ...

Event Manager
I own an outdoor store that sells training classes, tours, seminars, and similar type items. I currently use another POS system in the store but would like to use MS RMS, because I have it at another location and would like all locations to be the sames software. What I need is an RMS add in that manages events I mentioned. Ideally the software would allow me to create the event and schedule the same class multiple times and allow the class to cross multiple days, such as 2 consecutive sundays. The software would allow the sale to occur at the POS. The software would create a roste...

How can I remove time from event banners?
Installed Outlook on new laptop and transferred over info. The banners on my all day events now include a time of 12:00am. I have tried everything to get rid of the time. How can I get the times off the banners? How did you transfer the info over? Usually you need to open each one and fix the time but if you used import, open the pst directly in outlook instead and see if they are ok. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subs...

Event 12002 Errors
We are seeing the following error logged every couple of seconds for a user here. His mailbox has been removed (deleted and purged) and we are STILL seeing this error. Does anyone have any ideas what would cause this or how to stop these errors? Error 8004011B-820003A2 occurred while processing message <> from 'David Morris'. Thanks in advance, Jim FYI HOTFIX 829093 fixed this problem for us. http://support.microsoft.com/default.aspx?scid=kb;en-us;829093 Mention that this is a free hotfix, when you contact Microsoft Support Services (800) 936-4900 for the hotfix. It requir...

Trigger
CREATE TABLE tblA ( Symbol varchar(50) NOT NULL, APIFormat varchar(50) NULL, DataFormat varchar(50) NULL ) I would like to do the following: If a new row is added or APIFormat is edited, and DataFormat is not being updated, I would like to set DataFormat like this: If RIGHT(APIFORMAT,1) = '#', then SET DataFormat = LEFT(APIFORMAT,LEN(APIFORMAT)-1) + '0' If right(apiformat,1) <> '#', then SET DataFormat = APIFORMAT If I do the below trigger, if I don't update DataFormat, it sets it correctly, but...

could not unregister BLM trigger
Hello: One of our Dynamics GP 9.0 clients is experiencing an unusual error message when exiting Report Writer and returning to GP. Although the error message is not priventing them from using Report Writer or GP, it is a point of interest. And, I would like to see what can be done to eliminate this message. The message is "Could not unregister the BLM trigger." Does anyone know what this means or how to eliminate it? I do not know, as of yet, if all workstations get this message or if even only just some users get this message. Thanks! childofthe1980s Hi I would sugg...

Macro With Timer Event
I wish to write a macro using the normal tools which consists of a simple copy/paste over series of events. How can I incorporate a timer to delay the copy/paste events for something like 30 to 60 seconds? Is there a useful bit of code that I can obtain and paste into the code that I will be creating or will it require something like a hidden dialogue box with a timer on it? VBA has a function called Timer, a long-type integer that represents the current number of seconds since midnight. You can use this in code to create a delay of a number of seconds like this: Sub Delay() Dim Beg As Lo...

SQL Triggers in Headquarters
We are planning on implementing RMS and Headquarters for our multiple-store retail sales (do not have it installed yet). We are also going to have a virtual store, which will sell items from our brick-and-mortar store inventory. Without getting into too many details at this time, we have determined that the best way for us to accomplish our business needs is to have an external SQL database which will be used to keep track of brick-and-mortar store inventory and will also be used to record virtual store sales. We would then have triggers on this database and on the Headquarters databas...

Trigger on IVR10015
I'm trying to find a way to capture the actual created date on new items when the item copy function is used (when you use the copy function it stores the created date of the source item as the created date of the new item). We have manufacturing but we don't have the QA module, so I was trying to add a trigger to IVR10015 to put the current date in the QA Start Date field and or the QA End Date field upon insert to IVR10015. When I do that and add a new item I get the message below. How can I tell what the constraint is that is being violated? Any other ideas on how to capt...

Possible to trigger rules from MSN through VBA?
I understand that it is not possible to apply rules to email that comes in from MSN. In my case, my Outlook 2003 knows about two email sources, a POP3 account and an MSN account. Is it possible to write a VB macro that, upon delivery of an MSN email message, transfers that email message to the top of the POP3 email tree and have the rules execute on it from there? -- Richard Lewis Haggard www.Haggard-And-Associates.com ...

event tickets
I am trying to make seating cards to look like a tennis ticket event you would go to. (ie: US OPEN) Vertical ticket--Using some microsoft program-- not very computer literate.. publisher,excel,powerpoint,etc--that I could print out--any suggestions. I would love to have a picture of a tennis stadium on top and the words below. Thanks You can do this in Publisher. You will have to determine the size of the ticket. Will they be numbered? There is plenty of clipart on the Office web site. http://office.microsoft.com/clipart/default.aspx?lc=en-us You also could do an image search on Google,...

Event when message is dropped in folder
I am making an add-in for Outlook 2002 in VB.NET. I can access Explorers, folders and so on with no problems. I now would like to listen for events generated when an e-mail message is dragged and dropped into a specific folder. How do I achieve this? I suspect that i should initialize some "WithEvents-variable" in my OnConnection-sub, but i cannot figure out which object I should monitor... I found a useful answer in the thread: http://groups.google.dk/group/microsoft.public.outlook/browse_frm/thread/4ccb91443c21c2db/f029a33ce368f4d1?q=event+folder&rnum=25#f029a33ce368f4d1 I...

Exchange events not firing
This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C5A4FE.1FC54E80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi I have an Exchange server and an application that relies on Exchange = events being fired on a folder when items are added/deleted. This has been working fine, but now the events do not appear to be = firing. I have checked that permissions on the mailbox and the event = handler in COM+ are fine, and there is still a SystemMaibox on the = server that looks OK (although how do I tell?) The only chan...

Event logging
Hi, I a running XP64 and I as hit by a virus the other day. It affected my 32 bit browser (IE8) and ran multiple copies that tried to connect to advertising sites. all seems clear now BUT... the browser seems a little slow and somtimes does not connect to a site. Eventvwr.msc has a log installed for explorer but I never see any errors repotred. i cannot find how to set this on. Any ideas please? Regards, Dave On Sun, 6 Dec 2009 11:43:29 +0100, "Squeezy99" <david.cunningham@free.fr> wrote: > Hi, > I a running XP64 and I as hit by a virus the othe...

Not In List Event and Requery Errors
I am using Access 2007. I have a form named frmRoll with control RMItemNumber with the Limit to List property set to "Yes". This control is bound to a field in the table tblWIPTable. I have event code for the NotInList event for the RMItemNumber control. When the user enters a new value that is not in the tblWIP, the code properly opens the form frmWIPTable and populates the RMItemNumber field with the NewData value that the user has entered. Once the form is updated with the new information, I close the frmWIPTable. At this point I get an Access window that says "The text...

Docmd.Applyfilter and OnCurrent event ?
Does Docmd.Applyfilter trigger the OnCurrent event for the first record retrieved by the filter? In my case it does not appear to be, should it? I have data from a related record that needs to be displayed in unbound fields and I'm relying on the OnCurrent event to load it. Thanks. Never mind. "mscertified" wrote: > Does Docmd.Applyfilter trigger the OnCurrent event for the first record > retrieved by the filter? > In my case it does not appear to be, should it? > > I have data from a related record that needs to be displayed in unbound > fields and I&...

Replication Not being Triggered
Guys, I've created a new user more than 15 minutes ago and this user has not been replicated yet from the branch to my hub site. I'm testing the replication because of a few complaints of late that the replication is not happening as fast as it should. Any ideas of where I can start looking. I tested using dcdiag, repadmin and everything is ok. However, if i force the replication repadmin /replicate it works fine. I don't want to have to invoke replication everytime an object is created. Nik. Nik schrieb: > I've created a new user more than 15 minutes...

Combining multiple click events
Is there a way to combine multiple click events into one relatively short function? What i have right now is a form with two sets of checkboxes. Each set is about 25 check boxes. When the form loads, the most commonly selected ones are automatically checked. But to save time, I also added a "select all" button for each set of check boxes. When you click it, it will auto check each of the 25. Uncheck it and all 25 are unchecked. What I want to happen is if I click the "select all" checkbox and then uncheck one of the 25 options, the "select all&qu...

Macro events
Hi At present I am running a macro which list the files in a specified directory on a worksheet using the following events, Sub Worksheet_Activate() Sub Worksheet_SelectionChange(ByVal Target As Range). Can I run the macro whenever a file is saved to this directory? Thanks. Hi Better use an UDF Here are 3 UDF's, combining which allows you to list all files of certain type in folder, the workbook is saved in, and/or in all of it's subfolders Public Function GetSubfolder(MyFolder As String, FolderNum As Integer, Optional MyTime As Date) Dim fs, f, f1, s, sf Set fs = ...

Anout raise events
Hi! Here I have some text that I dont fully understand. It says. "Which of the following elements are NOT required if you want a custom class to raise an event. 1 A class that holds event data derived from System.EventArgs 2 A delegete for the event 3 A method to add an eventhandler 4 A class that raises the event. The answer is 3: You do not need a method to add an event handler that functionalitty is provided by the .NET Framework. When I first read this I thould that the meant the event hander that is acting when the event is raised but that is probable wrong. ...

Event 9667
How do I resolve this error in SBS 2003 Premium? Thanks, Tom Event Type: Error Event Source: MSExchangeIS Event Category: General Event ID: 9667 Date: 12/7/2009 Time: 10:35:57 PM User: N/A Computer: SERVER Description: Failed to create a new named property for database "First Storage Group\Mailbox Store (SERVER)" because the number of named properties reached the quota limit (8192). User attempting to create the named property: "SYSTEM" Named property GUID: 00020386-0000-0000-c000-000000000046 Named property name/id: "X-Llfyop" &quo...

Save Event
How do a call the Save event automatically using VBA? I want to force the user to save when they close the window by clicking the X object on the top right hand side of the window. Any help would be appreciated Have you tried the before modal dialog event in VBA to hit the 'Save' button each time it comes up? "Tremor Olaes" wrote: > How do a call the Save event automatically using VBA? I want to force the > user to save when they close the window by clicking the X object on the top > right hand side of the window. Any help would be appreciated This is th...