473,386 Members | 1,733 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.

Q on weird subform skip behaviour

Help, I'm getting strange results on a subform and I'm wondering if
anybody knows what is causing it...

I have a form linked to TableA. On that form is a tab control. Page1 is
just the controls for TableA, except for the caseID (PK) which is above
the tab control.

Then on Page2 of the tab I have a linked subform that's bound (via
caseID so it's a one-to-one relationship due to number of fields) to
TableB, and so on for Page3.

What's happening is that on FormB and FormC there are a bunch of option
groups interspersed with text boxes. Tab order is set correctly. For the
first few option groups on Page3 (FormC) everything works fine, when I
use the tab key to navigate through there's no problem.

But when I get to the second section of the form, which is not visible
when you first click on the page (it's a long form), every time I _Enter
one of the checkboxes in that section the focus moves to teh correct
control, but on the display it takes me up to the very top of the
subform, so the control I just entered is not visible anymore.

That has apparently only been happening for the last few days, the
client says she hasn't seen this before, she could tab through the
controls all the way to the bottom of the form.

Couple other potential factors: each section has a huge label
surrounding it. I did the SendToBack with no effect, adn there are no
handlers on the labels.

Each of the option groups (the ones that work fine *and* the ones that
get screwy results) have identical _Enter and _Exit handlers that change
the background color of the control to mimic the conditional formatting
"HasFocus" that you can do with a text box or combo box. I checked the
code, and these are working fine and have not changed.

Added a _OnDirty handler to see if maybe a control up near the top was
getting changed, but that handler never fires.

When you click on either Page2 or Page3 you are moving to a subform so
we have some _BeforeUpdate and _AfterUpdate handlers for the main Form A
that will insert a new record into FormB/C. That's been there, though,
and no changes to the subroutine for awhile.

When I open FormC as a standalone this doesn't happen, I can tab through
the controls with no problems. Thinking Ther ewas a corruption issue I
tried copying FormC and renaming, no luck. I tried opening a blank form
and copying the entire contents of FormA, still no luck.

I searched the KB but didn't find anything using several different
search phrases (not sure what to call this).

Has anybody seen a similar phenomenon? What causes it?

One possible workaround occurred to me, on the checkboxes we could add
code to somehow capture the scrollbar position inside the subform and
scroll back to the location of the ActiveControl. Or, we could grab the
"coordinates" of the ACtiveControl and then scroll to them after the
subform has done its mischief. Sort of a kludge either way and I'd
rather eliminate the problem entirely, but I'm willing to add that in if
necessary. Is it possible to grab the scrollbar location of a (sub)form
and then programmatically reset the scrollbar position to that value
later with VBA code?

Or do you know of a slicker solution?

Thanks for your help and for reading through this epic!
--
Terrell Miller
mi******@bellsouth.net

"Every gardener knows nature's random cruelty"
-Paul Simon RE: George Harrison
Nov 13 '05 #1
1 1798
Sounds as if you are refreshing your data for your subform on the
Subform_Enter event or something along those lines. Any kind of update
to the data in the table the subform is based on will produce similar
results. Sometimes with updates or with any sort of SQL that is running
as the result of an event followed by a refresh or requery command
(more likely the requery) you'll see erratic behavior for which record
gets the focus when you go back into the subform. If there is any kind
of SetFocus command in the subform, you may also get undesired results.
I'd start by looking for a requery command somewhere in the code.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chris Mantoulidis | last post by:
I see some really weird output from this program (compiled with GCC 3.3.2 under Linux). #include <iostream> using namespace std; int main() { char *s; s = "test1"; cout << "s = " << s << "...
8
by: Deano | last post by:
Here's the code; Private Sub txtTeachName_LostFocus() If IsNull(Me.txtName) Then 'line A Forms!frmMainform!frmSubform.Locked = True GoTo Exit_txtName Else 'line B...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
by: Tim Marshall | last post by:
The following is happening in two instances in A2003. The one I s\describe is the easiest one. Theme controls and autocorrupt have been turned off long ago. An unbound main form with a list...
7
by: Neil Ginsberg | last post by:
I'm having some problems with an Access 2000 MDB file with a SQL Server 7 back end, using ODBC linked tables. I previously wrote about this, but am reposting it with some additional information and...
2
by: Anthony England | last post by:
I wonder if anyone would have 5 minutes to check this for me. Access XP with new database created: Simple table tblTest: ID=autonumber, F1=Text with a few sample records frmSub has this as its...
12
by: sparks | last post by:
My boss and I both have access 97 and access 2003 installed on our systems. Lately he has been having a lot of problems. Databases that won't close. The database looks like it closes but access...
4
by: BerkshireGuy | last post by:
I have a form, with a subform that changes AllowsEdits,AllowAdditions, etc depending on who is coming in. This is done by using the OpenArgs and is working fine. However, if the user is...
13
by: MLH | last post by:
I have a form, frmVehicleEntryForm. On it is a subform control named frmAddnlOwnrListSubForm. The subform control's source object is frmAddnlOwnrListSubForm. When I click on the subform control,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.