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?
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?