Unexpected Results in form (1 Viewer)

twcaddell

Registered User.
Local time
Today, 07:12
Joined
Apr 8, 2013
Messages
31
Hi All
I have a "Main" form that has multiple pages to it. Three of those pages have the same functionality in managing our contracts. All three forms have main subform that lists all the jobs under that contract and a second subform that lists the specific data for the job that is selected in the main subform. On the second subform, I have a button that opens up a report, does configuration to the report, saves and closes it and then produces a PDF.

The problem is with one of the three pages. When the report closes, the focus returns to the "Main" form, but goes to the first page on the form and not the page that was active. The other two forms remain on the page from where the report was produced.

I have stepped through the code and cannot determine why this happens.

Any ideas?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:12
Joined
Feb 28, 2001
Messages
27,001
If you have a "form Enter" or "form Activate" event, it might happen in code for either of those events, because they might fire after a report closes.

In general, you pick a tab by loading a value to the tab control. If you look for any code that touches the tab control to load it, you have found your culprit.
 

twcaddell

Registered User.
Local time
Today, 07:12
Joined
Apr 8, 2013
Messages
31
Doc,
I had just discovered your solution prior to receiving the email. I did indeed have a form activate where I set the tab index number based on the contract name. I forgot to include the elseif statement for the new contract.

Again, thanks for taking the time to provide me the answer.
 

Users who are viewing this thread

Top Bottom