Previously used/opened record

I would like to have a button to hit to get me to my previously opened/used 
record. Can anybody please oblige me with some code to achieve that?

Thanks, RF. 

0
royfarnol
12/18/2009 10:06:45 PM
access 16762 articles. 3 followers. Follow

5 Replies
585 Views

Similar Articles

[PageSpeed] 10

Define "previously"...

No, seriously, until you can tell Access HOW to find the "previous" record, 
Access won't know what to do.

By "previously opened/used" do you mean "most recently" (a single record) or 
ALL records that have been opened/used.

If the latter, since when?

If a record is only "opened" (?looked at but not changed?), does that count?

What do you mean by "used"?  Does that mean altered?

More info, please...!

Regards

Jeff Boyce
Microsoft Access MVP

-- 
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"royfarnol" <royfarnol@kol.co.nz> wrote in message 
news:%23uj$j5CgKHA.1460@TK2MSFTNGP06.phx.gbl...
>I would like to have a button to hit to get me to my previously opened/used 
>record. Can anybody please oblige me with some code to achieve that?
>
> Thanks, RF. 


0
Jeff
12/18/2009 10:53:46 PM
>>to get me to my previously opened/used record. 
A little more information.  How long ago?  How used?

-- 
Build a little, test a little.


"royfarnol" wrote:

> I would like to have a button to hit to get me to my previously opened/used 
> record. Can anybody please oblige me with some code to achieve that?
> 
> Thanks, RF. 
> 
> .
> 
0
Utf
12/18/2009 10:59:02 PM
Say I look at record 27 and this record suggests to me that I ought to 
lperhaps look at record 14 when I look at record 14 I would like to be able 
to hit a return button to get back to record 27 without necessarily having 
altered anything in record 14.

When I get back to record 27 the button then presumably would/should/could 
take me back to record 14 if I so desired.

I hope that is clearer. Thanks Roy.

"Jeff Boyce" <nonsense@nonsense.com> wrote in message 
news:uE$21TDgKHA.3552@TK2MSFTNGP06.phx.gbl...
> Define "previously"...
>
> No, seriously, until you can tell Access HOW to find the "previous" 
> record, Access won't know what to do.
>
> By "previously opened/used" do you mean "most recently" (a single record) 
> or ALL records that have been opened/used.
>
> If the latter, since when?
>
> If a record is only "opened" (?looked at but not changed?), does that 
> count?
>
> What do you mean by "used"?  Does that mean altered?
>
> More info, please...!
>
> Regards
>
> Jeff Boyce
> Microsoft Access MVP
>
> -- 
> Disclaimer: This author may have received products and services mentioned
> in this post. Mention and/or description of a product or service herein
> does not constitute endorsement thereof.
>
> Any code or pseudocode included in this post is offered "as is", with no
> guarantee as to suitability.
>
> You can thank the FTC of the USA for making this disclaimer
> possible/necessary.
>
> "royfarnol" <royfarnol@kol.co.nz> wrote in message 
> news:%23uj$j5CgKHA.1460@TK2MSFTNGP06.phx.gbl...
>>I would like to have a button to hit to get me to my previously 
>>opened/used record. Can anybody please oblige me with some code to achieve 
>>that?
>>
>> Thanks, RF.
>
> 

0
royfarnol
12/19/2009 5:03:04 AM
I can think of several ways to do this.

One way involves two variables to track the primary key of the records and the 
current event of the form.

Assumption: the primary key of the record is a long integer (or autonumber)

'Declare the two variables in the Declarations section of the form module.

Dim lCurrent as Long, lPrevious as Long

Private Sub Form_Current()

If Not(Me.NewRecord) Then
    lPrevious = lCurrent
    lCurrent = Me.PrimaryKey
End IF

End Sub

Now as you move from record to record you will always have the primary key of 
the current and previous record to use in returning to the previous record. 
If lPrevious is zero then you have no previous record.

The button code would depend on what your recordset was.  In many of my 
databases the user is working with only ONE record at a time and the recordset 
consists of only one record.

There is a small problem with the above in that a new record won't have a 
value and if you delete a record you can't return to it.  That implies that 
you will need to control lPrevious and lCurrent in the Delete and Insert events.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

royfarnol wrote:
> Say I look at record 27 and this record suggests to me that I ought to 
> lperhaps look at record 14 when I look at record 14 I would like to be 
> able to hit a return button to get back to record 27 without necessarily 
> having altered anything in record 14.
> 
> When I get back to record 27 the button then presumably 
> would/should/could take me back to record 14 if I so desired.
> 
> I hope that is clearer. Thanks Roy.
> 
> "Jeff Boyce" <nonsense@nonsense.com> wrote in message 
> news:uE$21TDgKHA.3552@TK2MSFTNGP06.phx.gbl...
>> Define "previously"...
>>
>> No, seriously, until you can tell Access HOW to find the "previous" 
>> record, Access won't know what to do.
>>
>> By "previously opened/used" do you mean "most recently" (a single 
>> record) or ALL records that have been opened/used.
>>
>> If the latter, since when?
>>
>> If a record is only "opened" (?looked at but not changed?), does that 
>> count?
>>
>> What do you mean by "used"?  Does that mean altered?
>>
>> More info, please...!
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Access MVP
>>
>> -- 
>> Disclaimer: This author may have received products and services mentioned
>> in this post. Mention and/or description of a product or service herein
>> does not constitute endorsement thereof.
>>
>> Any code or pseudocode included in this post is offered "as is", with no
>> guarantee as to suitability.
>>
>> You can thank the FTC of the USA for making this disclaimer
>> possible/necessary.
>>
>> "royfarnol" <royfarnol@kol.co.nz> wrote in message 
>> news:%23uj$j5CgKHA.1460@TK2MSFTNGP06.phx.gbl...
>>> I would like to have a button to hit to get me to my previously 
>>> opened/used record. Can anybody please oblige me with some code to 
>>> achieve that?
>>>
>>> Thanks, RF.
>>
>>
> 
0
John
12/19/2009 2:36:36 PM
Thanks I'll give that a go. Roy.

"John Spencer" <spencer@chpdm.edu> wrote in message 
news:eAqosiLgKHA.2188@TK2MSFTNGP04.phx.gbl...
>I can think of several ways to do this.
>
> One way involves two variables to track the primary key of the records and 
> the current event of the form.
>
> Assumption: the primary key of the record is a long integer (or 
> autonumber)
>
> 'Declare the two variables in the Declarations section of the form module.
>
> Dim lCurrent as Long, lPrevious as Long
>
> Private Sub Form_Current()
>
> If Not(Me.NewRecord) Then
>    lPrevious = lCurrent
>    lCurrent = Me.PrimaryKey
> End IF
>
> End Sub
>
> Now as you move from record to record you will always have the primary key 
> of the current and previous record to use in returning to the previous 
> record. If lPrevious is zero then you have no previous record.
>
> The button code would depend on what your recordset was.  In many of my 
> databases the user is working with only ONE record at a time and the 
> recordset consists of only one record.
>
> There is a small problem with the above in that a new record won't have a 
> value and if you delete a record you can't return to it.  That implies 
> that you will need to control lPrevious and lCurrent in the Delete and 
> Insert events.
>
> John Spencer
> Access MVP 2002-2005, 2007-2009
> The Hilltop Institute
> University of Maryland Baltimore County
>
> royfarnol wrote:
>> Say I look at record 27 and this record suggests to me that I ought to 
>> lperhaps look at record 14 when I look at record 14 I would like to be 
>> able to hit a return button to get back to record 27 without necessarily 
>> having altered anything in record 14.
>>
>> When I get back to record 27 the button then presumably 
>> would/should/could take me back to record 14 if I so desired.
>>
>> I hope that is clearer. Thanks Roy.
>>
>> "Jeff Boyce" <nonsense@nonsense.com> wrote in message 
>> news:uE$21TDgKHA.3552@TK2MSFTNGP06.phx.gbl...
>>> Define "previously"...
>>>
>>> No, seriously, until you can tell Access HOW to find the "previous" 
>>> record, Access won't know what to do.
>>>
>>> By "previously opened/used" do you mean "most recently" (a single 
>>> record) or ALL records that have been opened/used.
>>>
>>> If the latter, since when?
>>>
>>> If a record is only "opened" (?looked at but not changed?), does that 
>>> count?
>>>
>>> What do you mean by "used"?  Does that mean altered?
>>>
>>> More info, please...!
>>>
>>> Regards
>>>
>>> Jeff Boyce
>>> Microsoft Access MVP
>>>
>>> -- 
>>> Disclaimer: This author may have received products and services 
>>> mentioned
>>> in this post. Mention and/or description of a product or service herein
>>> does not constitute endorsement thereof.
>>>
>>> Any code or pseudocode included in this post is offered "as is", with no
>>> guarantee as to suitability.
>>>
>>> You can thank the FTC of the USA for making this disclaimer
>>> possible/necessary.
>>>
>>> "royfarnol" <royfarnol@kol.co.nz> wrote in message 
>>> news:%23uj$j5CgKHA.1460@TK2MSFTNGP06.phx.gbl...
>>>> I would like to have a button to hit to get me to my previously 
>>>> opened/used record. Can anybody please oblige me with some code to 
>>>> achieve that?
>>>>
>>>> Thanks, RF.
>>>
>>>
>> 

0
royfarnol
12/20/2009 12:23:08 AM
Reply:

Similar Artilces:

how to active the ribbon Tab automatically when the form opens[Access 2007]
Dear I built a ribbon tab for a form. It works fine and when the form opening, the ribbon will be loaded fine. But it would be focus (or active) automatically. It still focus in the tab where I set now. Please help.!!urgent.!! Another question: is the callbacks for the ribbon always in Modules? I remember in Access 2003, the callbacks function could be in the form class modules. If all the callbacks should be in the Modules, does it mean we need distinguish which form or report is active now? Thank you very much. Jason Jiang Hi Ribbon is the new command bar system in office 2007...

Uses for Screen OCR technology
I have technology that is similar to OCR technology except that it determines rather than estimates its results. The main advantage over conventional OCR technology is that it is much more accurate with very small fonts. Current testing indicates that it can achieve 100% accuracy with fonts as small as 6 point. It also works with both types of font smoothing. I have thought of a few different uses for this technology, I want to see if anyone here can come up with any more uses. -- Patented SeeScreen enables programs to see anything on the computer display screen www.SeeScreen.com ...

using Outlook on local machine with domain user account
I have a small network running with w2k domain. Client computers run under w2k pro and have Office 2000 installed. * When I log on locally (with administrative privileges) Outlook works fine. * When I log on to the domain (using any domain user account) Outlook does not start. * When I add a domain user account to local administrators group and log on to the domain Outlook works fine. How to make Outlook working when domain user account is used (without administrative privileges on local machine) or I must use an account that has administrative privileges on local machine to run Outlook? ...

Allow a contact to use its Account's addresses
Since contacts associated to an Account all use the same addresses, allow a contact to use its Account's addresses ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=9c809...

"a document with the name" error on opening file
I'm getting an error message that says "A documents with the name " & filename & " is already open" (where filename is the actual name of the file) when I try to open certain files in Excel 97, when I don't really have a copy of the file in question opens. This error comes up pretty consistantly on one file that lives on a server, but I also get it when I try to open some local files. Anyone have any idea what would cause this & how to fix it? Thanks in advance. Best Jim Hi Jim have a look at: http://www.contextures.com/xlfaqApp.html#AlreadyOpen ...

cannot open entourage
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: pop The message I get is&quot;Cannot open this database with this version of Entourage&quot;. I have already tried rebuilding the database, doesn't work. Is there anything else you could sugeest? On 2010-06-03 07:27:04 -0400, MacIan@officeformac.com said: > The message I get is"Cannot open this database with this version of > Entourage". I have already tried rebuilding the database, doesn't work. > Is there anything else you could sugeest? Update Entourage...

Can you use the old Lotus "/ commands" in Excel 2003?
In Excel 2000 you could use a demo mode to activate the old Lotus menu commands. Can you do this in Excel 2003? Look at Tools>Option>Transition -- Kind regards, Niek Otten "DAW" <DAW@discussions.microsoft.com> wrote in message news:B5590E6E-DFE1-4A9A-8651-387B7F49D112@microsoft.com... > In Excel 2000 you could use a demo mode to activate the old Lotus menu > commands. Can you do this in Excel 2003? > It's gone from xl2003. DAW wrote: > > In Excel 2000 you could use a demo mode to activate the old Lotus menu > commands. Can you do thi...

word attachments on e-mail, docx files, recipient unable to open
I have been sending e-mails as I always have and attaching them in the way I always have, all of a sudden word documents are coming up as docx files and the recipients cannot open them, I have only recently gone onto Vista and microsoft offoce 2007. This has only happened recently with new docs that I have created on the new system. It is frustrating my customers and my hair is now falling out. Please help! That's because Word 2007 saves documents in a new format, .docx, unless told to do otherwise. There are two solutions: 1. Do a "Save As" and save documents in Word 97-...

Open a Publisher document without having Publisher
Is it possible? Can I convert the publisher doc to something else to then be able to open it? Can't even be done with a crowbar. You need Publisher, version of the same or later version as the pub file. -- Don Vancouver, USA "edd1121" <edd1121@discussions.microsoft.com> wrote in message news:F2C98EFB-1A94-4976-A9FA-9293B4942113@microsoft.com... > Is it possible? Can I convert the publisher doc to something else to then > be > able to open it? What about a BMF hammer? ;-) -- JoAnn Paules MVP Microsoft [Publisher] "Don Schmidt" <R...

attachment is grey cannot open
cannot open attachment. attachment is grey See www.oehelp.com/OETips.aspx#1 The same applies for WinMail. steve "dravidm" <dravidm@discussions.microsoft.com> wrote in message = news:4290840E-7192-446A-940F-5AEC42A8A55C@microsoft.com... > cannot open attachment. attachment is grey ...

Opening Attachments in Outlook 2000
A recent user of mine complained about opening emails with attachments included while on the road, dialing in over a modem line. He wanted to know if there was any way to just receive the text from the message without having to download the attachments once the email is opened....any suggestions? thanks! He could always use www.mailwasher.net to view mail text only. David "**Jeff" <jlemay@artel.com> wrote in message news:0be301c35c23$964d3980$a401280a@phx.gbl... > A recent user of mine complained about opening emails with > attachments included while on the roa...

how do I stop PERSONAL.XLSB from showing every time XL opens?
This workbook comes up every time I open XL - then I have to create a new workbook. How can I stop this workbook from opening automatically? I am using Office 2007. hi if the personal.xlsb is in the xl start folder, it will open with xl. it should open hidden so try hidding it. the personal.xlsb workbook should contain all of your personal macros and stuff that you want available at all times, hidden in the background. if not then remove the workbook from the xl start folder. regards FSt1 "Kerry S" wrote: > This workbook comes up every time I open XL -...

Search folder criteria
I am using Outlook 2007. How can I customise my search folder to filter messages that contain "KSC" in subject OR belong to "Sports" category? Is there a reason why "KSC" cannot not be assigned "Sports" catagory? Melissa wrote: > I am using Outlook 2007. > How can I customise my search folder to filter messages that contain "KSC" > in subject OR belong to "Sports" category? ...

Access 2003 Security Message On Open
All, I have approximately 15 databases that I am about to migrate to Access 2003 from 2000. I do not want the security message to appear every time one of my users logs on to the database. Registry changes and digital signatures are out of the question. If I put Application.AutomationSecurity = msoAutomationSecurityLow on open of my start up form will this prevent the warning message? Is there something I can put in the windows shortcut to turn this off? I have seen some suggestions were it is mentioned to call a script that calls the database to open in low security mode. Is this nec...

Using Building Blocks, Content Controls and XMLMappings to generate multi-page template-generated sections in a Word Document
Dear Readers, I would like some of your insight and feedback regarding a document I am creating. Here is the scenario. The document is a package that describes a toy collection. There is supposed to be a section in the document which consists of a sequence of pages that repeat an identical one-page template for each item in the collection. I have an XML document (Excel Table mapped export) which describes each item in the collection, and I would like to programmatically generate these pages of the document from the content in the XML file and the presentation in the template. S...

Money 2002 opens very slowly! Started few days ago!!! HELP
Hi to all, I have problem with Money2002. It is full with data from last year and until few days ago everything was ok. In average it would took about 3-5sec for MsMoney to open all the data, but since yesterday I need to wait app 10- 15sec for MsMoney to open. I tried everything but no luck. Anybody have a clue what this could be. Thanks in advance Is 15 seconds really that long to wait? What other programs and data have you installes/saved in the last year. Is your drives getting full? In microsoft.public.money, John wrote: > >I have problem with Money2002. It is full with...

Using innerXml and outerXml on a xmlDataDocument leaks cpu-resourc
Selecting element nodes from a xmlDataDocument using the childNodes collection or by using selectSingleNode and then reading innerXml or outerXml leaks cpu-resources. A trivial example showing this behaviour is included below. Running this example increases the cpu-load gradually and reaches 100% within a minute or two. The problem exists with innerXml as well as outerXml operations. Using a xmlDocument instead of a xmlDataDocument does not show this behaviour. Imports System.Xml Public Class Form1 Inherits System.Windows.Forms.Form Private xmlData As New XmlDataDocument ...

Sending attachments using Business Contact Manager Mail Merge
I've just upgraded to Outlook Business Contact Manager 2003 and am trying to send an attachment to several contacts using the mail merge facility. When you click mail merge it takes you to Word, so I cannot understand how you attach a document to the message you have written. I'm sure it is very simple, I just need a little help please!!! Kate:confused: ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ...

New Record
I have a form/subform. I have an event that opens a popup. I select from a list on the popup that copies the value onto a txtbox on the Main form and the popup then automatically closes. In the same code I place the focus in the subform to begin adding data to a new record. The problem I 'm having is that when the focus is set in the sub, there are two lines. The top line, which is the one I'm entering data in, does not automatically put the autonumber in for the ID that links the tables, but the record below it does, which is one that I'm not using. When I fill in the...

Identifying Duplicate Records
I have a dynamically created and amended table which occasionally contains duplicate records. These duplicates must be allowed but need to be flagged-up, when they occur, and marked in the table. Setting the No Duplicates property is clearly inappropriate. I can think of one or two ways of going about the job, including, perhaps running two nearly identical queries, one with the unique records property set and the other without, then comparing the results but the details of subsequently identifying and marking the appropriate entries have started to suggest some rather prolix VBA and...

Can I use 1 function in this case?
I have several control on my dialog. Each control has its message processing function. for example: ON_BN_CLICKED(IDC_BUTTON_ADD, OnBnClickedButtonAdd) ON_BN_CLICKED(IDC_BUTTON_SUB, OnBnClickedButtonSub) ON_BN_CLICKED(IDC_BUTTON_MUL, OnBnClickedButtonMul) Can I just use 1 function to process all messages? ON_BN_CLICKED(IDC_BUTTON_ADD, OnBnClickedButtonMath) ON_BN_CLICKED(IDC_BUTTON_SUB, OnBnClickedButtonMath) ON_BN_CLICKED(IDC_BUTTON_MUL, OnBnClickedButtonMath) If yes, how to decide which control send the message? Lookup ON_CONTROL_RANGE on MSDN. -- Regards, Nish [VC++ MVP] "ka...

Find Where Specific Fonts Have Been Used in a PowerPoint Presentat
Is there a way to find where specific fonts have been used in a PowerPoint presentation. The Contents tab of the Advanced Properties pane list the fonts that are used in a presentation but not where. MS Word will search for fonts with the find dialogue. I am looking for similar functionality with PowerPoint. In article <6CDAC5DB-AFCF-4485-9EAB-5146B5B5411C@microsoft.com>, John B wrote: > Is there a way to find where specific fonts have been used in a PowerPoint > presentation. The Contents tab of the Advanced Properties pane list the > fonts that are used in a...

Subreport Data Listing Twice for Each Report Record
On a report & subreport pair, the subreport data is listing out twice, and I can't seem to sort out why. Any suggestions appreciated. -- Thanks, tbl tbl wrote: >On a report & subreport pair, the subreport data is listing >out twice, and I can't seem to sort out why. Does the subreport diplay two records? If so, the problem is that your main report's record source query has a Join to the subreport's data source. -- Marsh MVP [MS Access] in article bq9q83pdvsepjusn44j91g84rpveu5a9bk@4ax.com, Marshall Barton at marshbarton@wowway.com wrote on 7/5/07 1:18 PM...

error message while opening the stored proc.
Can anybody view the stored procedure code - installed by eConnect on GPS database (Stored procs created after you install eConnect e.g. taSopHdrIvcInsert) I get error message while opening the stored proc. Error 20585: [SQL-DMO]/*******Encrypted object is not transferable, and script can not be generaqted. ******/ any comments ? ...

[ANN] "Dbl-Click Won't Open..." Issues
This message has been cross-posted to the Macintosh Word, PowerPoint, Excel & Office groups. The problem some of you have been experiencing whereby a file received via email refuses to open when double-clicked has been traced to email and/or web browser software mishandling the file sometime during its life cycle. Apparently certain programs of those types modify a key identifier in MS Office files which the 2008 apps require in order to be activated & open a file when it's double-clicked . Although identity of the software hasn't been identified, MacBU is working with the de...