First, thank you very much for helping.
I'm facing some difficulties with the code behavior. I have used a sequence of Debug.Print to check the code flux and apparently, part of the code is simply not executed. No code error is informed.
Please, take a look at the following code:
Expand|Select|Wrap|Line Numbers
- Call InsHst(TXT, "HTP", Sc, "", "", "", Form_WRS.Código, , Form_PR.PRIDX, , , Id.COD, Id.Ini)
- DoCmd.Close
- With Form_WRS
- .SetFocus
- .EMDCH = False
- End With
- Debug.Print "Checkpoint 1"
- DoCmd.Maximize
- Form_WRS.PRODUTOS.SetFocus
- Debug.Print "Checkpoint 2"
- Form_PR.PRHSTC = True
- Debug.Print "Checkpoint 3"
- Form_PN.PNRMK = TXT
- Debug.Print "Checkpoint 4"
- Form_PR.PRDCD = Nz(FORM_PRDCD, Now())
- Debug.Print "Checkpoint 5"
- If Nz(Form_PR.PRUCD, 0) = 0 Then Form_PR.PRUCD = Id.COD
- Debug.Print "Checkpoint 6"
- Form_PR.PRDUC = Now()
- Debug.Print "Checkpoint 7"
- Call frmDICAS("PR")
- Debug.Print "Checkpoint 8"
- Debug.Print Form_PR.PRDUC
- Debug.Print Id.Nam, Id.Cls, Id.AlC
If I comment the line 'Form_PR.PRHSTC = True then I can see Checkpoint 3 and Checkpoint 4, but I can't see Checkpoint 5 and so on.
This piece of code is being executed in the same form that is being closed in the line Docmd.close.
Do you think this can be a problem?
Let's say I'm closing a form that has the code being executed. What happens with the code after the docmd.close instruction? will it be executed until the end?
Best regards
Ricardo de Milano