473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Strange flux in the code

41 32bit
Dear Helper...
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
  1. Call InsHst(TXT, "HTP", Sc, "", "", "", Form_WRS.Código, , Form_PR.PRIDX, , , Id.COD, Id.Ini)
  2.                  DoCmd.Close
  3.                  With Form_WRS
  4.                       .SetFocus
  5.                       .EMDCH = False
  6.                  End With
  7.                  Debug.Print "Checkpoint 1"
  8.                  DoCmd.Maximize
  9.                  Form_WRS.PRODUTOS.SetFocus
  10.                  Debug.Print "Checkpoint 2"
  11.                  Form_PR.PRHSTC = True
  12.                  Debug.Print "Checkpoint 3"
  13.                  Form_PN.PNRMK = TXT
  14.                  Debug.Print "Checkpoint 4"
  15.                  Form_PR.PRDCD = Nz(FORM_PRDCD, Now())
  16.                  Debug.Print "Checkpoint 5"
  17.                  If Nz(Form_PR.PRUCD, 0) = 0 Then Form_PR.PRUCD = Id.COD
  18.                  Debug.Print "Checkpoint 6"
  19.                  Form_PR.PRDUC = Now()
  20.                  Debug.Print "Checkpoint 7"
  21.                  Call frmDICAS("PR")
  22.                  Debug.Print "Checkpoint 8"
  23.                  Debug.Print Form_PR.PRDUC
  24.                  Debug.Print Id.Nam, Id.Cls, Id.AlC
  25.  
In this first example, I can see in the debug screen the message Checkpoint 1, Checkpoint 2, but I can't see the message Checkpoint 3.

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
Oct 22 '15 #1
3 864
Rabbit
12,516 Expert Mod 8TB
You can't reference a form that's closed. Close the form only after you're done using it.
Oct 22 '15 #2
Ricardo de Mila
41 32bit
Sorry... I think I didn't explain the question correctly.
The forms that are being referenced are openned. They are Form_WRS, Form_PR and Form_PN.
The form that was closed is the one that has the button who started this procedure.
Oct 22 '15 #3
Rabbit
12,516 Expert Mod 8TB
You should still move it to the end.
Oct 22 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Harvey Twyman | last post by:
I have code written under the CCS 'C' Compiler to run on a PIC microcontroller. Code Extract: ------------------------------- char a,b,c; ------------------------------- c = ( a == b );...
3
by: A User | last post by:
Very strange - this code is copy and paste from the net and works on 2 of my 3 development machines - but of course not the machine I need to run it on. I've seen similar posts, but no solutions...
1
by: Fabrizio | last post by:
On a web page i found a very strange html code (see at the en of this message) to set the type of the characters (like bold, italic, etc.) and I have 2 question 1) How interpreter this code ?...
21
by: mm | last post by:
(Yes, I konw whats an object is...) BTW. I did a translation of a pi callculation programm in C to Python. (Do it by your own... ;-) -------- Calc PI for 800 digs(?). (german: Stellen) ------...
2
by: cmt | last post by:
Greetings I have a web page with an ASP script in it that is not displaying all the data from the SQL Server DB correctly in a form. I have one line in the code, that is doing some strange...
16
by: Victor | last post by:
I have a strange problem in my website. I configured my website to run under 2 worker processes. (web garden enabled). and I stored my user information in the current httpcontext(like...
0
by: charmeda103 | last post by:
when i run my program it runs with no erorrs but the output screen is giving me strange results here is whats its giving me: CONFERENCE OVERALL RANK TEAM W-L % WINS MARGIN W-L ...
6
by: Promedeus | last post by:
Hello, I am incredibly puzzled. I have made a small, fairly simple calculator for specific purposes. I can run this fine on my computer. But when I try to run it on a target computer (from Norway)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.