Here is the copied
Code:
Private Sub DRAcc_DblClick(Cancel As Integer)
DoCmd.Close acForm, "SelectAccount", acSaveNo
DoCmd.OpenForm "SelectAccount", acFormDS, , , acFormReadOnly, acDialog, "DrAcc"
Beep
DRAName = DLookup("AccName", "AccountChart", "AccNumber = '" & DRAcc & "'")
Let DRCTL = DLookup("AccControlled", "AccountChart", "AccNumber = '" & DRAcc & "'")
DRAmount.SetFocus
End Sub
Now the way I understand it (if one can understand stuff at age 66 that is), is that when the [DoCmd.OpenForm "SelectAccount", acFormDS, , , acFormReadOnly, acDialog, "DrAcc"] executes, the called form "SelectAccount" should open as a popup, and execution of the rest of the code should hold back until the called form is closed.
However, in my effort, the form opens as it should, but processing continues (I hear the beep), which also causes a problem as the rest of the code (DRAmount.SetFocus) fails as it is only once the called process is reacted on, that I have the required details.
Have I got my story wrong or is the code just not right? The code above is exactly as it appears in my calling form's module. The called form just allocates the selected account number to the calling form. It is just a case of the calling process continuing when I thought it won't. (That is why I added the beep in the calling code sequence).
Will be great to get this resolved - thanks.