A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Stay with Current Record



 
 
Thread Tools Display Modes
  #1  
Old February 9th, 2006, 12:06 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Stay with Current Record

Here we go again ......

Currently have a form "frmMainform" with subform "frmSubForm" where/when
there is no data in the subform I CLICK on a button to invoke a
"frmPopUpForm" to add info to the subform table which is bound. After close,
the requery statement takes place and requeries but returns the
"frmMainForm" and the related "frmSubform" to the first record of the
"frmMainForm".
How do I stay with the same record I was viewing when I invoked the
"frmPopUpForm"?

Regards


  #2  
Old February 9th, 2006, 12:47 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Stay with Current Record

Store the primary key of the current record
Then do the requery
Then find the record that has the primary key.

Something like the following UNTESTED AIRCODE.

Dim lngPK as Long

lngPK = Me.PrimaryKey

Me.Requery

With Me.RecordsetClone
.FindFirst "PrimaryKey = " & lngPk
if .NoMatch = False then
Me.BookMark = .Bookmark
End if
end With

Tee See wrote:

Here we go again ......

Currently have a form "frmMainform" with subform "frmSubForm" where/when
there is no data in the subform I CLICK on a button to invoke a
"frmPopUpForm" to add info to the subform table which is bound. After close,
the requery statement takes place and requeries but returns the
"frmMainForm" and the related "frmSubform" to the first record of the
"frmMainForm".
How do I stay with the same record I was viewing when I invoked the
"frmPopUpForm"?

Regards

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding tables Gertjan Running & Setting Up Queries 1 December 19th, 2005 04:20 PM
Question abt POP form to current record details... Brook Using Forms 2 December 13th, 2005 06:27 AM
Need Help In Printing Current Record in Specific Report RNUSZ@OKDPS Setting Up & Running Reports 1 May 16th, 2005 09:06 PM
Multiple Report printing for current record from check box terry New Users 6 April 14th, 2005 09:29 PM
Transferring Current Record From One Form To Another Abilly General Discussion 1 August 3rd, 2004 01:05 PM


All times are GMT +1. The time now is 10:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.