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
1274 Views

Similar Articles

[PageSpeed] 34

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:

Recordset not Updatable.
I am getting an error message stating "Recordset not updatable." when I try to edit a data field in a form. The form is based on a query that contains data from a table and other queries. Each of the tables and their associated queries all have a Primary Key. In fact, the primary Key is the same in each table. Did I do something wrong on the design end? (I am able to create a query with just one table and update the information. It is only when I join to the other queries do I have this problem) TIA Antonio Antonio, if you open the query directly, can you edit the data ...

Originating Amount Updated
Hello: A GP 8.0 client conducted GL year-end close. When she ran file maintenance for the Account Transaction History table, the check link report said "Originating Amount Updated". I don't think that there is cause for alarm. But, what does this message mean? Thanks! childofthe1980s There was some incorrect data in the "originating amount" field. That field is used by the multi-currency module. If you are not using multi-currency, the amounts should be the same. "childothe1980s" wrote: > Hello: > > A GP 8.0 client conducted GL year-end ...

printer server on domain controller on 2008 x
The server service was unable to map error code 1723.For some reason, the print servers on our one domain controller VSDCA keep going offline.. so i log into the server, i see under Print Management.. Print Servers.. that "VSDCA (local)" has a red arrow pointing down, implying it must be offline.. If i right click i dont have an option of bringing it back online, if i do a properties i get: Print Server Properties Server properties cannot be viewed. Operation could not be completed (error 0x000006bb). I took a look in the event log.. i dont see much pertaining t...

event firing in Access 2007 (retreat/load events)
I have an 2003 database running under Access 2007. When creating a report, I noticed some anomalies: 1. Retreat event is not fired at all (after a group header is formatted but not printed) 2. Appearently, report Load event fires when I do a print preview, but does not fire when I export to pdf Am I missing something, or is this a bug? Thanks, ...

NDR Event logs 3018 & 3030
Although diagnostic logging for NDR is set to none under the MSExchangeTransport category in Exchange 2003, I still get some event logs 3018 or 3030. Any idea how to get rid of them? These events relate to public folder replication. Check your logging levels under MSExchangeIS\Public Folder -- Tyrone Cowart Microsoft PSS Please do not send email directly to this alias. This alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights. "Claude Wacker" <bcdwacker@hotmail.com> wrote in message news:4d54ffb9.040122...

Chart not updating (Recently moved to Excel XP)
Since we upgraded to Microsoft Excel we have had a problem with miscelanious graphs not updating. I have gone to options and checked automatic update correctly, and still the problem contiues. For this email I am focusing on one of my more important graphs. Background: 1) We recently converted the office from Excel 97 to Excel XP, worked great before the upgrade. 2) The graph is pulling from hidden sheets that have data imported to it from an Access 97 database. 3) The graph that is not updating includes bars and lines. Any help you might be able to provide would be GREATLY ...

Event Handler
Hello, I use an COM server that creates a number of events. I have created a class that controls the COM server and that receives the events, it's called LaserCtrl. This works! I have a form that uses LaserCtrl and I want to update a textbox in the form from LaserCtrl. The constructor of LaserCtrl looks like this private TextBox msg; public LaserCtrl(TextBox m) { msg = m; } From a normal method in LaserCtrl this works perfectly msg.Text = "my nice message"; BUT from the EventHandler method nothing happens...

gal not updating on clients
hi there, i hav updated my company employees contact number on active directory which is working with exchange 2003 (integrated mode) but the microsoft outlook clients r not being updated... is there anyway i can forcefully update gal on clients. regards ANWAR ADIL CCNA , MCP On Sat, 29 Oct 2005 14:30:43 +0500, "ANWAR ADIL" <anwar@innovativetechpk.com> wrote: >hi there, > i hav updated my company employees contact number on active >directory which is working with exchange 2003 (integrated mode) but the >microsoft outlook clients r ...

automatically get an alert when someone adds an event to public Calendar?
Is there a way to automatically get an alert when someone adds an event to a public Calendar? Having the person who added the event send me an invite is not an option, because they will not do this. (I am required to check the calendar to see if any events have been added.) I can't see a way to quickly see what new events have been added so I have to check the whole calendar. (Or is there a way to view events by the date they were added, not the date of the event?) TJ There should be some solutions for this at = http://www.slipstick.com/addins/notify.htm=20 --=20 Sue Mosher, Outlook...

Events, dear boy, events #2
Hi Bob Yes I'm certain. I'm right-clicking the worksheet tab to view th sheet's code page, then pasting the in the event code.. -- Gromi ----------------------------------------------------------------------- Gromit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=92 View this thread: http://www.excelforum.com/showthread.php?threadid=27721 ...

AfterUpdate/BeforeUpdate and SetFocus
I have some problems with the SetFocus command in a Userform with an AfterUpdate or BeforeUpdate routine. To make it clear to you, I made a very small Userform to demonstrate it. It only contains 8 TextBoxes and this code: Code: Private Sub TextBox01_AfterUpdate() Me.TextBox08.SetFocus End Sub - Private Sub TextBox02_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox03_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox04_Change() TextBox08.SetFocus End Sub I expected that in ...

How do I automatically update page numbers in a footer?
I have inserted "Page { PAGE } of { NUMPAGES }" into a footer, different first page, and I need the NUMPAGES to automatically update when the file is opened as Read-only. Does anyone know how to get this to happen? Updating fields in footers is tricky. The easiest way to do it is to Print Preview the doc, but I don't think that helps you. I assume you're having someone else view the read-only doc? "B-" wrote: > I have inserted "Page { PAGE } of { NUMPAGES }" into a footer, different > first page, and I need the NUMPAGES to automa...

Meta content in the event log
Hello All Programmer, I want to put Hyperlink in content of Event Log! just like --> For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. this type of hyperlink comes in the content part when windows create the event log message. some buddy told me that this is possible when we send hyperlink in the meta tag. so i want to know that exact procedure... Thanks Ashutosh Hi Ashutosh, We have reviewed this issue and are currently researching on it. We will update you ASAP. Thanks for your patience! regards, Rhett Gong...

control chart
Help, I know how to create a line chart, (run chart) but I want to show mean and standard deviation, can you help? Check: On my site: Excel | Tutorials | Color Zone in XY Charts Excel | Tutorials | Shaded Bands as well as Jon Peltier's site: http://www.peltiertech.com/Excel/Charts/statscharts.html -- Regards, Tushar Mehta, MS MVP -- Excel www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <E7CB20C0-3B83-4EA5-B933-55FFE7E5B211@microsoft.com>, anonymous@discussions.microsoft.com says... > Help, I know how t...

CScrollbar events in VS 2003
I've added a scroll bar to a dialog in a new dialog only mfc app. but the only event I can find for it is NM_THEMECHANGED (which throws a compiler error)? Can I add my own WM_SCROLL handlers? Thanks ...

Task Update History
Hi! We use MS Project 2007 and we are having an issue getting resources to report their hours every day. Is there a history report that would show us the history of which days each resource reported their time? Thank you! Stacey Sorry but Project Server 2007 does not have those kind of detailed logging capabilities. Are you using My Timesheets or My Tasks or both? If you are using My Timesheets, you might be able to create an SSRS or Data Analysis report that shows which days the resources have reported hours against. Jonathan "Stacey" <Stacey@discuss...

Message Sending from a Control to MainFrame Window
Hello, I wrote an MDI-MFC application with a DialogToolBar. The DialogToolBar is created in the MainFrame. In the DialogToolBar I places some common controls. I would be able to handle all messages from the common controls in the MainFrame. Ofcourse I can write for each message of a wrapper, which sends the message to the MainFrame. But I think there must be a possiblity to send these messages direct to the mainframe. It would be very nice, if anybody can give me some hint. best regards Bernhard P.S. Posted also at comp.os.ms-windows.kprogrammer.tools.mfc Bernhard Kohn wrote: >...

AfterUpdate
Hello Chaps, In the AfterUpdate code I had the detail back colour change if a check box (tbc) = True. However if I tick the box now it turns the back colour of every form irrespective if that record is ticked tbc or not! Any help on solving this would be great. JAMES Private Sub tbc_afterupdate() If Me.tbc = True Then Me.Section(0).BackColor = 65535 Else Me.Section(0).BackColor = 16777215 End If End Sub If you are using a continuous form, that code won't work. The good news is that you can use Conditional Formatting to make it work. In Design View, select the combo box and fro...

Using the onchange event of a picklist to change the label of a fi
I would like to set the Field Lable of a particular field on my form based upon the user's selection of a particular value in a Picklist. Is there any way to use the onchange event to dynamically set the Label of a field on the form? There is no supported way to do this, but if you understand Javascript and DHTML, you can figure out the right section of the form to "update". Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Tue, 16 Aug 2005 23:49:05 -0700, "cdobkins" <cdobkins@discussions.micros...

AfterUpdate Question!
I want to add this to my code , Ony enter date if [DateCheck] (checkbox) is -1 Any help would be great..............Thanks Bob Private Sub tbAdditionCharge_AfterUpdate() If tbDayNo.value = "" Or IsNull(tbDayNo.value) Then tbDayNo.value = Format(Now, "dd-mmm-yy") End If End Sub Hi Bob, Me.tbDayNo=IIf(Me.DateCheck And IsNull(tbDayNo), _ Format(Date,"dd/mm/yy"),tbDayNo) Regards Jacob "Bob V" <rjvance@ihug.co.nz> wrote in message news:%23xApdzD7HHA.4880@TK2MSFTNGP03.phx.gbl... | | I want to add this to my code , Ony enter date if [D...

Combo Box Control
Hi, all I have a combo box control in the form, the environment is VS .Net 2003. Could anybody tell how the make the combo dropdown list can show more than 1 line each time. Thanks a lot! -ja "ja" <josndrsn@yahoo.com> wrote in message news:OvEoXQY0GHA.720@TK2MSFTNGP02.phx.gbl... > Hi, all > I have a combo box control in the form, the environment is VS .Net > 2003. Could anybody tell how the make the combo dropdown list can show > more than 1 line each time. Thanks a lot! > Resize the dropdown portion in the resource editor? -- Jeff Partch [VC++...

How do I update links from .xls sheets to .xlms sheets
I have thousands of links to many consolidated spreadsheets created in Excel 2003. Now that I use Excel 2007, how do I convert the links without breaking them. On Apr 21, 2:06=A0pm, June <J...@discussions.microsoft.com> wrote: > I have thousands of links to many consolidated spreadsheets created in Ex= cel > 2003. =A0Now that I use Excel 2007, how do I convert the links without br= eaking > them. After making a copy of your workbook, try to search and replace ".xls" with ".xlms" Hope this helps, Chris M. It's not clear what you'v...

Controls on spreadsheet size
Folks, I have a spreadsheet that contains about 3MB of raw data. However, once I have formatted it using colours, charts, fonts etc, the size of the sheet balloons to 38MB. What are the key controls on spreadsheet size in Excel? Is it sheer data volume, formats, formulas, VB code? Any ideas how I can retain some of the formatting without having something of a monster sheet on my hands? Cheers, Matt My guess only: I can't control the amount of data--I need what I need. Same thing with formulas. But I can control the amount of formatting I use. I can format complete columns (or...

Why is the data pulled down from an online update, ALL WRONG?
I'm using Money 2004 Deluxe. I just figured out how to get online updates for my 403(b) from Fidelity. I've pull everything down into MS Money. Looked cool, at least for a while. Then I noticed that out of the 6 mutual funds I'm investing in, only 2 had symbols associated with them. So I tried to assign the symbols to the other 4. Only thing is when I did, I got error messages saying that the symbol was already in use. So then I went into help and found that if I went to the Investing menu option and choose "Work With Investments" and then choose "Choose ...

XL2003 Destination and Source Open but not updating
Hi, I recently migrated to 2003 and when using a file created in 2000/2002 the links do not update when the Source file is open. First, I opent the destination workbook, choose not to update links, open the source workbook and make changes. The changes are not updated in the destination workbook. If I edit the equation in the destination workbook by deleting the path ('\\server\folder\[filename]sheet'!cellref) up to the filename of the source, then the values update. Once I close the source, the equation in the destination changes to a mapped drive type path ('S:\folde...