I have a Assets sub-form. When an Asset is acquired, I want to get the transaction entry number for that item from the accounting form. I call a function to open the accounting form in which I select the proper item. That form closes and the focus returns to the Asset form. However, the Asset form does not get updated. I need to click another button to update the asset record. I must not be calling up the popup form correctly so that the value gets updated in the target asset record upon closing the accounting form. Here is the function. The opened Team_Ledger_Sub-form puts the needed value in a small table for retrieval. The problem is that this function does not wait for the DoCmd to complete before it executes the the remaining lines in the function. Thus I need to execute the two lines following the DoCmd again in separate function. I am sure there must be a way to do this properly. I should have said that it doesn't get updated with the current value, but rather the old value from an earlier get call.
Private Sub TIDSave_Click()
Dim MyNum As Integer
DoCmd.OpenForm "Team_Ledger Subform"
MyNum = GetCurrData("CurrTID", "N")
Comment = "TID: " & Format(MyNum, "000000")
End Sub