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  

Find specific record



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2006, 12:11 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Find specific record

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/return with/to the same record I was viewing when I invoked
the
"frmPopUpForm"?
I posted this once before but lost the answer. I have attempted to solve by
myself using logical (in my mind) programming but get stuck as follows.

The following code is in the AfterUpdate event of the popup form. I added
the primitive error handling just to stop the entire thing freeeeezing up.
The code runs as I would expect until the dotted line. The variable
strFindRec holde the "value" through the requery (I think) since the
debug.Print statement shows the correct value in the Immediate window of the
VBA editor.
Why does the FindRecord statement foul/fowl up?

Private Sub Form_AfterUpdate()
On Error GoTo Err_Hand:
Dim strFindRec As String
strFindRec = Me![SISItemCode].Value
Forms![frmMaterialMasterMain].Requery
Debug.Print strFindRec
Forms![frmMaterialMasterMain]![SISItemCode].SetFocus
-------------------------------------------------------------------------------------------
DoCmd.FindRecord strFindRec, acAnywhere, , acSearchAll, , acAll, False
Err_Hand:
DoCmd.GoToRecord , , acFirst

End Sub




 




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
Find Specific Record using 2 controls timsken Using Forms 3 August 2nd, 2005 03:35 AM
'Search' box to find a record Jane Using Forms 1 September 26th, 2004 09:25 AM
find last modified record zealousagenda Running & Setting Up Queries 1 September 24th, 2004 09:41 AM
find and replace ladyinred General Discussion 14 August 12th, 2004 09:35 PM
Find Record in Subform Katherine R General Discussion 7 June 26th, 2004 03:22 PM


All times are GMT +1. The time now is 07:23 AM.


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