AfterUpdate event not firing when control is updated via code

I have a text box control on a form which is normally updated by the user. 
However, there are instances where a generic code is used in this field, and 
I have a button on the form that the user clicks to populate that control 
with the generic code. My problem is I have code in that text box control's 
AfterUpdate event that does not fire when the text box is updated by the 
command button's code. This is the underlying code of the command button (it 
pops up a form which updates the field in the main form... this is the code 
from that second form):


Private Sub Command24_Click()
DoCmd.SelectObject acForm, "Returns Entry Form"
Forms![Returns Entry Form].[PODField] = "000000/0000#" & Me![Frame5].Value
Forms![Returns Entry Form].[PODField].SetFocus
SendKeys "{ENTER}"
DoCmd.Close acForm, "MiscPOCodes"
End Sub

I've tried selecting the field and doing a SendKeys to it, but that doesn't 
seem to work either. I need this to work to help cut down on entry time, 
otherwise my users will have to remember these codes and type them in every 
time they need them (which is quite often).
0
Utf
3/11/2008 5:55:03 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1548 Views

Similar Articles

[PageSpeed] 45

Simply call the procedure.

Assuming this code is running in the Returns Entry Form, use:

Call PODField_AfterUpdate.

If it's running from some other form, go into the module for the form, and 
remove the keyword Private from the declaration for the AfterUpdate event. 
Then, use

Call Forms("Returns Entry Form").PODField_AfterUpdate


-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Nicholas Scarpinato" <NicholasScarpinato@discussions.microsoft.com> wrote 
in message news:CC21B0E1-79F1-4746-BC51-A9627B683A25@microsoft.com...
>I have a text box control on a form which is normally updated by the user.
> However, there are instances where a generic code is used in this field, 
> and
> I have a button on the form that the user clicks to populate that control
> with the generic code. My problem is I have code in that text box 
> control's
> AfterUpdate event that does not fire when the text box is updated by the
> command button's code. This is the underlying code of the command button 
> (it
> pops up a form which updates the field in the main form... this is the 
> code
> from that second form):
>
>
> Private Sub Command24_Click()
> DoCmd.SelectObject acForm, "Returns Entry Form"
> Forms![Returns Entry Form].[PODField] = "000000/0000#" & Me![Frame5].Value
> Forms![Returns Entry Form].[PODField].SetFocus
> SendKeys "{ENTER}"
> DoCmd.Close acForm, "MiscPOCodes"
> End Sub
>
> I've tried selecting the field and doing a SendKeys to it, but that 
> doesn't
> seem to work either. I need this to work to help cut down on entry time,
> otherwise my users will have to remember these codes and type them in 
> every
> time they need them (which is quite often). 


0
Douglas
3/11/2008 6:15:05 PM
As Homer Simpson would say, "D'oh!"

I never even thought about that. Not to mention that the AfterUpdate event 
of the field being updated only has one command... to call a function. I'll 
just call that function from the second form after I update the field.


Thanks!

"Douglas J. Steele" wrote:

> Simply call the procedure.
> 
> Assuming this code is running in the Returns Entry Form, use:
> 
> Call PODField_AfterUpdate.
> 
> If it's running from some other form, go into the module for the form, and 
> remove the keyword Private from the declaration for the AfterUpdate event. 
> Then, use
> 
> Call Forms("Returns Entry Form").PODField_AfterUpdate
> 
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Nicholas Scarpinato" <NicholasScarpinato@discussions.microsoft.com> wrote 
> in message news:CC21B0E1-79F1-4746-BC51-A9627B683A25@microsoft.com...
> >I have a text box control on a form which is normally updated by the user.
> > However, there are instances where a generic code is used in this field, 
> > and
> > I have a button on the form that the user clicks to populate that control
> > with the generic code. My problem is I have code in that text box 
> > control's
> > AfterUpdate event that does not fire when the text box is updated by the
> > command button's code. This is the underlying code of the command button 
> > (it
> > pops up a form which updates the field in the main form... this is the 
> > code
> > from that second form):
> >
> >
> > Private Sub Command24_Click()
> > DoCmd.SelectObject acForm, "Returns Entry Form"
> > Forms![Returns Entry Form].[PODField] = "000000/0000#" & Me![Frame5].Value
> > Forms![Returns Entry Form].[PODField].SetFocus
> > SendKeys "{ENTER}"
> > DoCmd.Close acForm, "MiscPOCodes"
> > End Sub
> >
> > I've tried selecting the field and doing a SendKeys to it, but that 
> > doesn't
> > seem to work either. I need this to work to help cut down on entry time,
> > otherwise my users will have to remember these codes and type them in 
> > every
> > time they need them (which is quite often). 
> 
> 
> 
0
Utf
3/11/2008 6:39:01 PM
Reply:

Similar Artilces:

National City auto-update
I used to be able to have Microsfot Money automatically download transactions from my accounts. Now whenever it goes to check it says it failed. I tried setting it up again but it prompts me "National City Requires a Password Change", but no matter what I enter in these boxes it says the password/pin is incorrect. I called National City and they said there wasn't anything wrong with my account. What should I do? In microsoft.public.money, Josh wrote: >I used to be able to have Microsfot Money automatically download transactions >from my accounts. Now whenever i...

Problem using Microsoft Web Browser control
I am trying to access the Custom properties of a Web Browser ActiveX control on a form and I keep getting a message telling me that "The Operation on the Microsoft Web Browser object failed. The OLE server may not be registered. To register the OLE server, reinstall it." I searched TechNet and MSDN and could not resolve this. I reinstalled Access 2003 (I have 2003 and 2007 installed on my workstation, XP Pro) and still no resolution. Has anyone else seen this and if so, can you tell me how to resolve this? Jim Does anyone know the name of the file the message...

Updating 20k+ rows from Excel to access. vbscript? VBA? SQL?
Any suggestions? Some of these rows only need a few columns updated, and others need all of them updated. If possible if say row 800 column 'S' is filled in the access DB but is blank on the excel spreadsheet, if possible i like to keep the existing data in access and over right it with a blank cell. The spreadsheet is a export of the access DB, changes were made/merged from other spreadsheets so the Unique ID is the same and in column A. A script suggestions to complete this? Thanks :) dim dbe dim db dim ssql set dbe = createobj("dao.dbengine.36") set db = dbe.openda...

ZIP codes beginning with 0
I'm having trouble getting ZIP codes beginning with 0 to stick, even when specifying ZIP code in the format category type. No matter what I do, the initial 0 always gets dropped. Advice? Thanks. Hi Peter.......... Either pre-format your cells as TEXT, or enter a leading apostrophe before entering the number with the leading 0........the apostrophe won't show, it only forces TEXT formatting on that cell.......... Vaya con Dios,] Chuck, CABGx3 "Peter" <anonymous@discussions.microsoft.com> wrote in message news:2ab7001c46836$3382cf70$a601280a@phx.gbl... > I&...

Removing RAID controller at XP boot up
I installed a pci card with two ATA 133 HD drive ports it came with drivers, I think I installed the wrong driver (RAID instead of straight). Cant get rid of the Marvel Raid control because it comes up before boot and has presumably tucked itself in the bios somewhere. Is there a solution? Perhaps reflashing the bios? Charlie+ "Charlie+" <charlie@xxx.net> wrote in message news:k47mq55qel8a848nl8u1l7rp31uvvdhg4m@4ax.com... > I installed a pci card with two ATA 133 HD drive ports it came with > drivers, > I think I installed the wrong driver (RAID inste...

Exchange 5.5 MTA Event-ID 290 after site removal
Hi, hopefully someone can help me. We have Exchange 5.5 Org (most SP4) – 1 hub site and 5 spoke sites. In our hub site we have 1 connector server and one mailbox server. Due to Exchange server consolidation, I removed one site (KB324340) – same procedure as I did it three times before - Now I’m getting every 4 hours on the bridgehead server in the hub site the following event-id, which points to the old and removed server/site: MTA Event-ID 290 – NDR,.. A non-delivery report (reason code unable-to-transfer and diagnostic code unrecognised-OR-name)) is being generated for message message. ...

SQL to update Item.LastCounted based on PhysicalInventory.CloseTime
Because of a bug/deficiency/oversight in a third party inventory counting application , I did a bunch of physical inventories that did not update the Item.LastCounted field. I need this field updated so I can see the correct date each item was counted last. I am willing to do a seperate SQL statement for each physical inventory sheet for which I have the problem. For example, I want to take each item in the PhysicalInventoryEntry table with PhysicalInventory.Code = '0000057' (or whatever the code is) and set Item.LastCounted = PhysicalInventory.CloseTime. I am not great at SQ...

RMS and Bar Coding
We are having a year end inventory count performed and need to send a file with all bar codes. Can we delete old bar codes that have not been used for awhile to shrink this file? Or can we send a numerical file with just the bar codes that currently show inventory? If so, how is this done? We own Store Operations 1.20 -- Joanne Mahoney SDN Consulting Jacksonville, FL ...

How to get looping VBA code to respond to events on worksheet
Hello, I have some code of the form do while not g_Paused bunch of calls ... loop where I'd like the variable g_Paused to be toggled by a button on the worksheet. The only way I can seem to get the code to respond to the button click is to use do while not g_Paused bunch of calls ... ThisWorkbook.Worksheets("Name").Activate DoEvents loop But this is pretty slow and causes the sheet to flicker...is there a better method? PS I'm using buttons from the Control Toolbox Thank you. ...

Tax Codes?
Does anyone know the tax codes Microsoft Money uses for transactions? Thanks, Brook In microsoft.public.money, Brook wrote: >Does anyone know the tax codes Microsoft Money uses for >transactions? Explain what you mean. What I am looking for are the Tax Codes for Different Transactions: I.E. If I wanted to create a 401k tracking within my Microsoft Money, I was trying to figure out how I need to tax code my transaction so everything appears properly. Hope this is clear. Brook >-----Original Message----- >In microsoft.public.money, Brook wrote: > >>Does anyone...

Add a new code macro
I have workbook that I am trying to use with a macro form another post on this form. It inserts a new row with the formulas and contents of the selected row. The problem is that it copies the row below the one selected, and because of this, I can not make a copy of row 2 below the column headers. Any ideas? Thanks. Here is the code: '/=======Start of Code==========================/ Sub InsertRowsAndFillFormulas() 'adds desired # of lines below the current line and ' copies the formulas to that/those lines 'added selection of more than one worksheet ' - Gary L. Brown &#...

Event 9646
E2K3 SP1; Mixed Mode I received a few of these in my Application Log on the E2K3 server, but I cannot find any information regarding them: Event Type: Error Event Source: MSExchangeIS Event Category: General Event ID: 9646 Date: 1/11/2005 Time: 10:30:51 AM User: N/A Computer: MXMA2 Description: Mapi session "/o=Org/ou=Site/cn=Recipients/cn=RMonti" exceeded the maximum of 32 objects of type "session". The MS KB Article http://support.microsoft.com/default.aspx?scid=kb;en-us;830836&sd=ee has the same Event ID, but does not reference the object of type "session&...

Using Code instead of Criteria
In my query builder, I'm getting the message: "The string returned by the builder is too long. The result will be truncated." I think I understand why, as I am using a form to specify a large number of options for the report. Can I use VB to specify these criteria instead of the query builder? Examples in query builder: If [Forms]![boxSeatsMailings]![PW] Criteria =1 and (PFDirect>0 or PFBulk>0 or PIDirect>0) then select record. If [Forms]![boxSeatsMailings]![PW] Criteria =2 and (PFDirect>0 or PFBulk>0 or PIDirect>0) then select record. As ind...

Lebans tooltip control 10-28-07
I am trying to use the tooltip control on a form with a tab control, on which are the other controls I want to show information for. On controls that are outside the tab control, it works fine; on controls inside the tab control, the tooltip shows on text boxes only when they have the focus, and on check boxes not at all. I've tried every naming scheme for controls I can think of, without any luck. Anybody have any ideas about this??? Is it the same problem as using a subform???? I am using ACCESS 2003 -- Jack Walsh ...

How to Enable Distribution Expansion Events?
How do I enable Event 26, "Distribution List Expansion" Events, showing up in the Tracking Logs? I have Message Tracking enabled everywhere I can, but these events will not show up. Dave ...

Todays Date that does not update
I created a macro and a button that when clicked it entered todays date in a cell, which is what I wanted. I used "Today( )". Problem is the date keeps updating to todays date and I want it to stay the date I entered it in. Is there some other value or formula to do this so it does not update everyday? Thanks!! You need to enter the date itself. Any function will always update to the current date. Ctrl+; will enter the current date in a cell. In VBA, use Range("A1").Value = Date -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC...

Event 4000 on Mobile registration
Anybody getting the same error? Any resolution? I've got the certificate items all ironed out but can't get the device to register. Funny but the administrator account synced just fine but a regular user won't. Event Type: Error Event Source: MBSDeviceRegistration Event Category: (40) Event ID: 4000 Date: 6/30/2006 Time: 1:16:34 PM User: N/A Computer: SLS-SERVER Description: Exiting service abruptly. Details: Exception details : Source : .Net SqlClient Data Provider Message : INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_ObjectTracker_Parent...

still having Event 1005 after rebooting
I've not heard a response to my followup on the 29th - Is any more information needed to assist me? Thanks, Art ---------------------------------------- "Art O'Malley" <aomalley@firstam.com-nospam> wrote in message news:uJnPGNiLEHA.2068@TK2MSFTNGP11.phx.gbl... > Source: MSExchangeAdmin > > "Ed Crowley [MVP]" <curspice@mvpsnospam.org> wrote in message > news:OO$dO9aLEHA.2260@TK2MSFTNGP09.phx.gbl... > > What service? > > -- > > Ed Crowley > > MVP - Exchange > > "Protecting the world from PSTs and brick ba...

COM communicate with managed code(.NET)
Hi! When I have a communication from COM to managed code(.NET) a type library(TLB) is necessary in between to handle the communication from COM to ..NET. I tried to use Red Gats's reflector to look into the type library that have extension tlb but it's not possible. So why is it not possible ? //Tony "Tony Johansson" <johansson.andersson@telia.com> wrote in message news:O%23lutgv5KHA.5464@TK2MSFTNGP05.phx.gbl... > I tried to use Red Gats's reflector to look into the type library that > have extension tlb but it's not possible. ...

Spinner Control and Protected Worksheet
I have inserted a SPINNER control in my worksheet > thereafter, I have REMOVED its "Locked" checkmark (format control > protection). Then, I protected the worksheet. When I try to use the spinner after protecting the workseet, the system says: "The cell or chart you are trying to change is protected and therefore read-only"!!! VERY VERY FRUSTRATING. Any suggestions ???? (worksheet enclosed - protected without a password for testing). Attachment filename: test.xls Download attachment: http://www.excelforum.com/attachment.php?postid...

Sum of calculated controls in footers
I have a report with the following groupings: 1.) Claimant 2.) Group 3.) Carrier in the Claimant footer I have the a control named max_ded with the following calculation =Max([Ded]). I need to be able to sum this field at the "group level", and then sum the "group level sum" at the carrier level. I have tried to sum(max([Ded])) and I get error messages. I have tried Sum([max_ded]) etc. Any ideas would be greatly appreciated. Thanks ...

money2004 hanging on updates
I upgraded from money2003 to money2004 last night, then went to online updates. The program can download my bank transactions but when it gets to "updating securities and news" it hangs. I cancel, and it hangs on "cancelling call". I end up having to cont-alt-del and restart money. Happens every time. Any suggestions or is it a server problem? thanks in advance In microsoft.public.money, jeff wrote: >I upgraded from money2003 to money2004 last night, then >went to online updates. The program can download my bank >transactions but when it gets to &q...

Edit control
Hi, I have a dialog window to display as modal, in the dialog , there is a edit control, the focus is in edit control, I want to catch the enter key when user press enter in edit control, but the dialog close when I press enter key(I donot want to close the dialog). How can I catch the enter pressed message in dialog? Thanks Jessie Hi Jassie, Note that any time you press enter and if the focus is in an edit ctrl the CDialog::OnOk() func will be called. If you override CYourDlg::OnOk, it means that this func will be called, and, of course, it contains the call of CDialog::OnOk. Hence, y...

No sound after updating SP2 for Vista
Hi,sorry if this is a duplicate post,but I'm not sure mine posted the first time,it's not coming up in my searches. My Dell Inspiron 1420 laptop automatically informed me of an important update last night,and I went ahead and clicked through it and restarted.It had me download the SP2 for Vista and install it,but when I turned my computer back on after the requisite restart,my computer wasn't making any sound whatsoever.I tried using the volume toggle on the taskbar,I tried pressing the volume and mute buttons on my laptop and playing with the volume sliders in eac...

character code
I'm trying to figure out the code for a rectangular block. I have some text that comes out of an old DOS program. It's mostly text but there are a few odd characters. I've handled most of them but one is a vertical rectangluar block. This old DOS program exports the block into a text file as a � (Y with an accent mark above it). I have a macro (vba code) that is converting the Y into a pipe symbol but I'd rather convert it into the block that it's supposed to be. If I open the DOS program, copy the text to the clipboard and paste it directly into Word it does show t...