Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-05-2016, 12:45 PM   #1
twcaddell
Newly Registered User
 
Join Date: Apr 2013
Posts: 31
Thanks: 7
Thanked 0 Times in 0 Posts
twcaddell is on a distinguished road
Unexpected Results in form

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?

twcaddell is offline   Reply With Quote
Old 10-05-2016, 06:50 PM   #2
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,248
Thanks: 86
Thanked 1,624 Times in 1,507 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Unexpected Results in form

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.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
twcaddell (10-06-2016)
Old 10-06-2016, 06:02 AM   #3
twcaddell
Newly Registered User
 
Join Date: Apr 2013
Posts: 31
Thanks: 7
Thanked 0 Times in 0 Posts
twcaddell is on a distinguished road
Re: Unexpected Results in form

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.

twcaddell is offline   Reply With Quote
Reply

Tags
focus on another page , forms , reports

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query giving unexpected results Aggie70 Queries 5 09-19-2014 10:36 AM
Query Giving Unexpected Results Toolguy Queries 2 12-22-2009 06:58 PM
complex query/form results unexpected Bhaughbb Queries 13 06-01-2006 11:57 AM
Unexpected DCount results Malcy Reports 2 01-05-2005 06:06 AM
Unexpected results from IIF statement KristenCarr Queries 5 04-12-2002 07:49 PM




All times are GMT -8. The time now is 07:15 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World