Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reposition one form from another form

Status
Not open for further replies.

PatBo

MIS
Feb 27, 2003
49
GB
From a form I open a second form; in the second form I choose a record to which the first firm must go. I use a RecordsetClone construction to move the first form to a particular value of [KeyField]:

Strng$ = "[KeyField]=" & Str(frmSecondForm!MyValue)
Set rstClone = Forms!frmFirstForm.RecordsetClone
rstClone.FindFirst Strng$
Forms!frmFirstForm.Bookmark = rstClone.Bookmark
rstClone.Close

This works fine; I see that the first form has moved to the record with the correct value of [KeyField]. However if I now do:

MsgBox Forms!frmFirstForm!KeyField

this returns the value of KeyField for the initial position of my first form, and not the value I now see on the screen. Playing with Refresh and Requery on the first form doesn't help (in fact Requery sends it back to the initial position!)

Any suggestions?

 
where are you putting your msgbox? sounds like in the wrong place.

rollie@bwsys.net
 
Rolliee asks:
>where are you putting your msgbox? sounds like in the wrong place

Just after rstClone.close. Does this matter? I would expect
Forms!frmFirstForm.Bookmark = rstClone.Bookmark
to have updated everything (it has updated the screen, but not apparently the value of the variable)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top