What is the last event when moving from record to record?

What is the last event that fires when moving off of a record. It needs to 
give me access to the values of the controls in the record I am moving off 
of. Thanks.
0
Utf
9/21/2007 7:52:02 PM
access.formscoding 7493 articles. 0 followers. Follow

5 Replies
4257 Views

Similar Articles

[PageSpeed] 33

=?Utf-8?B?bXNjZXJ0aWZpZWQ=?= <rupert@tigerlily.com> wrote in
news:1358FD7D-6CA4-42FC-8A2F-A83B85876300@microsoft.com: 

> What is the last event that fires when moving off of a record. It
> needs to give me access to the values of the controls in the
> record I am moving off of. Thanks.
> 
There isn't ONE. If you move off a record that has not been edited, 
only viewed, then it's the OnCurrent event. If you have edited the 
record it's the form's AfterUpdate Event. Those only apply if you move 
off a record t5o another record. If you move off the record by closing 
the form, then it's the Form_Close event.

What specifically are you trying to do? If you tell that, people can 
make better suggestions.

-- 
Bob Quintal

PA is y I've altered my email address.

-- 
Posted via a free Usenet account from http://www.teranews.com

0
Bob
9/21/2007 7:43:53 PM
mscertified wrote:
> What is the last event that fires when moving off of a record. It
> needs to give me access to the values of the controls in the record I
> am moving off of. Thanks.

Unfortunately there is no "about to leave record" event.  There is only a 
"just arrived at record" which is the Current event.

If the record you are about to leave has unsaved changes then you will see 
BeforeUpdate and AfterUpdate fire before you have actually left the record. 
There is no corresponding events for a record that does not have unsaved 
changes.

-- 
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com 


0
Rick
9/21/2007 8:55:04 PM
In news:1358FD7D-6CA4-42FC-8A2F-A83B85876300@microsoft.com,
mscertified <rupert@tigerlily.com> wrote:
> What is the last event that fires when moving off of a record. It
> needs to give me access to the values of the controls in the record I
> am moving off of. Thanks.

If it's really, really important to you, there's a way to simulate a 
"RecordExit" event.  See this MS KnowledgeBase article:

    http://support.microsoft.com/kb/304139
    How to programmatically implement a RecordExit event
    in Access 2002

I can't say I recommend it, though.

Maybe your needs for the values in the previous record's controls would 
be solved by having a set of variables to hold these values defined in 
the form's module, at module level.  In the form's Current event and the 
form's AfterUpdate event, you'd set all of those variables from the 
current values of the form's fields.  Depending on where you're using 
the values you capture, you might need to keep a separate set for the 
"record before this one".


-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


0
Dirk
9/22/2007 2:03:02 AM
"Dirk Goldgar" <dg@NOdataSPAMgnostics.com> wrote in
news:uevvoyL$HHA.1168@TK2MSFTNGP02.phx.gbl: 

> If it's really, really important to you, there's a way to simulate
> a "RecordExit" event.  See this MS KnowledgeBase article:
> 
>     http://support.microsoft.com/kb/304139
>     How to programmatically implement a RecordExit event
>     in Access 2002
> 
> I can't say I recommend it, though.

Looks terrible to me, as it's not really a RecordExit procedure at
all -- it actually moves back to the record after it's already moved
to the next record. 

And it depends on ADO, which is silly, in my opinion.

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
9/22/2007 4:34:11 AM
"Dirk Goldgar" <dg@NOdataSPAMgnostics.com> wrote in
news:uevvoyL$HHA.1168@TK2MSFTNGP02.phx.gbl: 

> Maybe your needs for the values in the previous record's controls
> would be solved by having a set of variables to hold these values
> defined in the form's module, at module level.  In the form's
> Current event and the form's AfterUpdate event, you'd set all of
> those variables from the current values of the form's fields. 
> Depending on where you're using the values you capture, you might
> need to keep a separate set for the "record before this one".

Sounds like a perfect situation for a class module for the record.

I'd probably implement the class module as a wrapper around an array
that would be sized for the number of fields needed. 

Then I'd have two instances of the class module, one for the current
record, one for the previous. 

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
9/22/2007 4:36:01 AM
Reply:

Similar Artilces:

Insert specific record information into new record
I've got a problem which I don't really know how to tackle. I've got a table with records which I fill out via a form. When I add a new record, I'd like some information to be filled in automatically based upon information available in previous records. But the expression I'm looking for has serveral instances. How do I pick the single information I need. Example. I'm filling out a form that holds order information of a customer. When I'm filling out a new for for the same customer I'd like information like address, contactperson etc to be equal to the informa...

After SaveAs Event
Hello, I have a VBA application that appears to work fine. My only known issue is that when I perform a manual Save As, I get a bunch of garbage on the active window. I have had this problem and the exact same garbage when running individual routines in the application, and have gotten rid of them with Application.ScreenUpdating=False. Minimally, my problem is that I have no clue where to put this after a manual SaveAs. In ThisWorkbook, I use Workbook_Open, Workbook_Deactivate, Workbook_Activate, and Workbook_SheetActivate. None of these appear to run during Save As ope...

Outlook and Palm, UNTIMED events?
Am using Outlook 2002. In the CALENDAR section, is there a way to enter an UNTIMED EVENT...a thing scheduled for a particular day, but no particular time. I don't want to put it in the general TASKS list because that isn't associated with a particular day. (You can enter untimed events on Palm desktop software.) One reason this is needed is to sync the Palm with Outlook (and stop using the Palm desktop software). But, my Palm handheld has lots of untimed events (and I would like to keep entering more), and question is...where would they go when sync'ed into Outlook....and wher...

How can I display worksheet summary page ie title/size/last updat.
I'm running MSExcel 2003. I am often working with large workbooks with mutiple worksheets. It would be v helpful if I could see/sort and print off a summary that shows worksheet properties similar to Explorer eg: workbook :xxxx ---------------- worksheet last update size names 1/2/04 64k companies: 5/2/03 893k etc... any ideas? Jon I wrote this sometime ago and it works as a workbook_open event (Needs to be placed in the ThisWorkbook code module). It could be adapted to work otherwise though. It adds a sheet and lists all the built-in and c...

Move Mail messages to a Public Folder
Hi Guys, I have an Exchange 2003 SBS Server, and I have just installed GFI ME10, and I have enabled the Public Folders Spam filtering, What I would like to be able to do is to have a button in Outlook that will move a message that has been identified as Spam to the public folder which GFI Monitors. I know I can use right click, expand public folders, open spam folder, then click move. I just want a button to do this in one click if at all possible. IS this at all possible? I cant understand why MS didnt allow us to record a Macro in Outlook. Many Thanks, Ryan O'Dwyer OK, I manag...

Email format changing when moving to next cell
I have an excel spreadsheet I created for when we get a new customer. The user opens the protected sheet and enters info by tabbing from cell to cell. I have changed the format of the email address cell to be Arial Narrow and bold, when I enter info and tab or enter out of that field the formatting changes to Arial and unbolded. How can I keep the format I want instead of what excel wants to default to? Thanks for the help! Kat in WI On Mon, 2 Apr 2007 16:17:49 -0500, "Kat" <kat@nospam.com> wrote: >I have an excel spreadsheet I created for when we get a ...

Find the last, 2nd last and 3rd last data in a column
I have data listed in several colums and need to create a formula to detail the last (most recent) 2nd last and 3rd last piece of data in the column. I have used the following formula to display the last but cant edit this or create another formula to get the 2nd and 3rd last pieces of data. =LOOKUP(2,1/(A:A<>0),A:A) Thanks in advance Jamie If there are no empty cells in the range: last cell: =INDEX(A:A,COUNTA(A:A)) penultimate: =INDEX(A:A,COUNTA(A:A)-1) semi-penultimate: =INDEX(A:A,COUNTA(A:A)-2) best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme r...

CSliderCtrl move Thumb to clicked postion
Hi All, I am using a CustomDraw CSliderCtrl Control. When I click on the Control the Thumb moves to a Particular position For eg. I have Range of 0 to 100 Thumb is at 0 When I click on Control in the middle the thumb moves to + 10 position. I want the thumb to be position at 50 Is there any way to do it. To understand what I want please Go To Windows media player and click on slider control you will get to know that the thumb is placed at where the user exactly clicks. not at predefined postions . Thanks Anup "Matrixinline" <anup.kataria@gmail.com> wrote in message ne...

[E2K7] move-Mailbox question
Greetings, Moving mailboxes from a 2003 server to a 2007 server. Last few mailboxes, one is 29G (129k items). I tried moving this mailbox earlier in the week, the move went on for 11hrs+ and didnt complete in the time i'd alotted so it cancelled. Started moving again earlier today expecting the move to take some time. Imagine to my surprise, that the move took only 3.5hrs. My question, what is the "expensive" part of the mailbox move process? Taking the scenario above into account, does it make sense that the most costly part of the move is the extension of the ...

How long will my capital last
Hi If I had a capital sum of say �100,000 and I was taking an annua income of 5% and I was getting 3.5% interest annually - Can you help m demonstrate how long my capital last? Thank you Dust -- Message posted from http://www.ExcelForum.com Dusty, =3DNPER(3.5%,-5000,100000,0) If, by 5%, you mean 5% of the original investment (=A35.000 each year), = your money will last for approximately 35 years at 3.5% interest. See Excel Help for more info on NPER(). Regards, Anders Silven "Durhamr" <Durhamr.yajun@excelforum-nospam.com> skrev i meddelandet = news:Durhamr.yajun@excelf...

Multi-select listbox question
I have a multi-select listbox and wish to obtain data from the last clicked record in the listbox (you'll notice that if you make multiple selections then only the last-clicked record has a dotted line around it). What, if any, listbox property identifies this record as last-clicked? Thanks Dave -- Posted via a free Usenet account from http://www.teranews.com ...

Event iD 2601 2604 2501
These errors have been popping up every fifteen minutes. They started a couple of days and won't go away. This is Exchange 2007 standard and there is no clustering. Event Type: Warning Event Source: MSExchange ADAccess Event Category: General Event ID: 2601 Date: 2/26/2007 Time: 10:43:24 AM User: N/A Computer: MAIL01 Description: Process MSEXCHANGEADTOPOLOGY (PID=1980). When initializing a remote procedure call (RPC) to the Microsoft Exchange Active Directory Topology service, Exchange could not retrieve the SID for account <WKGUID=DC1301662F547445B9C490A52961F8FC,CN=Microso...

why is my last digit converted to zero?
I'm using Excel 2003 and when I enter a 16-digit number or cut and paste a 16-digit number, the last digit is converted to zero. This does not happen with 15 digits or fewer. Excel's numeric precision is 15 decimal digits. If you need to calculate with the number, you probably won't miss anything. If the number is a key, such as a creditcard number, add an apostroph (single quote, " `") before it; it will not show, but it will cause the number to be treated as text. Another way is to format the cell as text before entering the number -- Kind Regards, Niek Otten ...

Handling ActiveX DLL Event in C#
Hi, I have to handle a VB 6.0 Application Generated event in my WPF application. I tried this following things but it does n't work. Could anyone of help to resolve this problem. May be pointing out good example of this scenario will also more helpful. Created a ActiveX Dll Project in VB 6.0 with a class Public Event OnConnectedEvent(FromPhoneURI As String) Public Event OnTerminatedEvent(FromPhoneURI As String) Public Sub Connect(ByVal FromPhoneURI As String) RaiseEvent OnConnectedEvent(FromPhoneURI) End Sub Public Sub Terminate(ByVal FromPhon...

Count Records in a SubForm
Hey everyone... Struggling with some syntax here. I'm trying to Count records in a subform. I have a textbox and have set it equal to many variations of the following... =[qryStudents subform1].[Form]![ID].[Form].[RecordsetClone]. [RecordCount] Most of the examples I've seen of this take the form of nameofsubformcontrol.Form.RecordsetClone.RecordCount What I'm having trouble with is, my subform control's name is qryStudents subform1. The field I'm trying is the ID field. How would I combine that into one line, so teh syntax above would work? Any ide...

Exchange Event ID 565
Hi, I've recently performed a swiing migration from sbs2000 to sbs2003 standard. Everything has been runnig fine except i have recently notice a large number of failed security events; on a daily basis there can be between 500-1000 approx of the same event. I have searched the web a fiar bit over the last week but anything i can find is on eventid.net but is slightly different errors. i have also noticed there have been other people asking about this error in this group but no fix as yet. Can anyone point me to any further resources? Any help appreciated. Object Server: Microsoft ...

Need help in searching last occurrence of string in text file
Hi , I am not good in file handling in excel macro..i need some help from u. I have one huge text file and i want to search last occurrence of string in that file and then cut the data after that searched line till end of file and paste it into a new text file. Any help appreciated. thanks in advance. How huge is "huge" (in Megs)? -- Rick (MVP - Excel) <sameer2211@gmail.com> wrote in message news:8cb08938-cf0e-4925-95bb-725f72df9f8d@25g2000prz.googlegroups.com... > Hi , > > I am not good in file handling in excel macro..i need some help from > u. > I hav...

SQL/MS Access Database : Update record with incremental view count.
Greetings, Even though Im working with JSP I connect to an MS Access Database, I want to select a record and then after the select Update the field 'ViewCount' by incrementing it by ONE each time the same record is retrieved via the SELECT * TABLE statement. To clarify I've done an example below, would this work? UPDATE TABLE SET = VIEWCOUNT = VIEWCOUNT + 1 WHERE ID = FORM.ID Hope this makes sense Rob W yah looks great but you need to do this instead UPDATE TABLE SET VIEWCOUNT =3D VIEWCOUNT + 1 WHERE ID =3D FORM.ID I think that you had one too many equal signs in t...

Print only current record
Using Access 2007. Hi all, I'm trying to figure out how to show a report only displaying the current record. I created a db using the Issues Database as a template. It has a form called Issue Details which has a button that prints a report of all issues. I created a new button and want to be able to print the same report but only with the record that is selected on the form. I searched the 'net and based on what I found I added this to the button's Click event: -------------------------------------- Private Sub Command188_Click() On Error GoTo Err_Command188_Click Dim MyFor...

Event firing when exiting a record
I need to check status of several fields as a specific record loses focus (to initiate a message box). I don't see that there's an event associated with this step. The only way I've thought to do this operation is to write code for the following steps: Define a variable (integer) Each time one of the fields I'm checking is modified, the variable gets amended. If the variable equals a set value, then pop-up the message box. Reset the variable after the message has been displayed. This would work, of course, but I feel there has to be a more elegant way to perform this check. ...

Last logged on by
Hello! Using exchange 2003. When I look under Adminstrative groups -> Server -> "name" -> First storage group -> mailbox store -> mailboxes you can se all the mailboxes that you have and last logged on by. Under last logged on by I can se that one person (me) have logged on on to diffrent acconts, even if I havent don it. WHAT is this? Best regards Micke Micke: Did you use your account as the service account for anti-virus or spam? Also, IIRC, even if you view someone's Outlook Calendar, it would mark the mailbox as being logged on by you. Regards...

How do I keep text from moving when I add a picture?
How do I keep text from moving when I add a picture? I know it's possible because I have done it before, no doubt by accident, on a different flyer. All I want to do is place a small picture from file between two words. Thanks. P.S. Please keep any responses as non-technical as possible as I am computer semi-illiterate. Click on picture, go to "text wrapping" on picture toolbar, select "none". "vwhobo" wrote: > How do I keep text from moving when I add a picture? I know it's possible > because I have done it before, no doubt by accident...

First and Last Problem
For some reason First and Last are giving the wrong data in a Totals query. I assume that somehow the data is not ordered correctly in the main table, but it does show correctly in the datasheet view. For example if I group the sample database below by Name and Year, First of Location should be B, unfortunately it shows up in the query as A. Name Year Stint Location Ed 1999 1 B Ed 1999 2 A Ed 2000 1 A Desired Result Name Year Stint Location Ed 1999 1 B (But shows up as A) Ed 2000 1 A Any ideas from someone who has seen thi...

Extract last name from Last, First
I know this has to be a common question, but I can't find the answer... Using VBA, I need to extract the last name from the format: Last, First For example: the cell contents extract to a variable the value of JONES, AMY JONES ADAMS, HARRY ADAMS Your help would really be appreciated! I don't know how you are using it, but this shows how to get it in a variable. Sub dk() Dim lName As String lName = Left(ActiveCell, InStr(ActiveCell, ",") - 1) MsgBox lName End Sub ...

how do I schedule a weekend event to be recurring in calendar
As an example the first Saturday and Sunday of August. If the first weekend for Saturday is on the seventh and Sunday the eigth, how can I schedule them to be recurring? If I try to do them separately, I end up with some years the Sunday is the second Sunday of the month and some years, Sunday is the first Sunday of the month. Monthly First Saturday of the month duration 2 days. And then Shift the ones that are too early individually. baker_collins wrote: > As an example the first Saturday and Sunday of August. If the first weekend > for Saturday is on the seventh an...