R
Roland Alden
I have a sequence of code in a click event handler as follows:
stDocName = "ed-person"
If CurrentProject.AllForms(stDocName).IsLoaded = False Then
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, acWindowNormal
End If
[Form_ed-person].FindUid (q)
FindUid takes a query string of the form "uid={someguid}" and does a
Me.Recordset.MoveFirst
Me.Recordset.Find q
Here's the situation.
If the form ed-person is not loaded it loads fine and displays the first
record; however the FindUid then executes but the form does not scroll to
the record specified by q.
If the form ed-person is loaded already it scrolls to the correct record as
per q.
I've made sure FindUid is not somehow getting bad data the first time
through and it's not. There is something about the execution of the
Me.Recordset.Find that silently fails if it is called in the same thread as
the instantiation of Me (the ed-person form)..
Is there something I need to do between the OpenForm and the called to
FindUid to allow the newly opened form to get ready for handling the FindUid
correctly?
stDocName = "ed-person"
If CurrentProject.AllForms(stDocName).IsLoaded = False Then
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, acWindowNormal
End If
[Form_ed-person].FindUid (q)
FindUid takes a query string of the form "uid={someguid}" and does a
Me.Recordset.MoveFirst
Me.Recordset.Find q
Here's the situation.
If the form ed-person is not loaded it loads fine and displays the first
record; however the FindUid then executes but the form does not scroll to
the record specified by q.
If the form ed-person is loaded already it scrolls to the correct record as
per q.
I've made sure FindUid is not somehow getting bad data the first time
through and it's not. There is something about the execution of the
Me.Recordset.Find that silently fails if it is called in the same thread as
the instantiation of Me (the ed-person form)..
Is there something I need to do between the OpenForm and the called to
FindUid to allow the newly opened form to get ready for handling the FindUid
correctly?