Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help-Form Acts Different With Debug Running 1

Status
Not open for further replies.

lreedy

Programmer
Jan 4, 2001
8
0
0
US
I have a form that has several text boxes the user can enter data to search the database to bring up a detail form of the data they select. If I run the form with debug on and the form acts correctly and brings up the correct data. If I step through with Debug, it acts correctly also.
If I run it without debug or the code view open, it does not run correctly and displays the wrong data.

Any ideas?
I have recompiled it also.
 
Debug doesn't like save record commands or anything that refers to the form in form view very much...Are you calling any functions or other outside of your form that could be throwing you a not obvious curve? Gord
ghubbell@total.net
 
First let me preference this by saying I am still pretty new at all this.

The user can select any one of several text boxes to search the item master database.

I check for which values are not null and run
SQL to lookup and populate one of 2 forms, a detail form if there is a direct match.

Or a listbox form, if there are several possible matches.

If I have the code view open....not even a break point defined... and I select an item numer, the detail screen is displayed correctly.

If I do not have the code view open, and I select an item number, The list form opens with no values in it.


 
I know of 2 problems w/ a Debug Window:
Focus & timing.

Focus:
If you have a DW open, the form looses focus. Some system objects like Screen.ActiveForm change. This can cause unexpected odd results. Also, stepping thru, you trigger GotFocus events multiple times.

Timing:
Events happen independently of one another.
Some queries execute independently, also.
If you issue a query or trigger an event, the results can complete as a different thread. If not debugging, then sometimes what you expect hasn't happened...yet.

These are real downfalls so:
Try to understand the Events where you place your code,
when & what order they are triggered,
and how to know if they are complete.

7ony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top