Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Reset subform in page control based on selection in other page control from a tab control on a form

I have a form:
"Main_Form"

I have a tabctrl:  "TabCtl27"

On page29 of the tabctrl27 I have a subform:
"Panel1 subform"
The recordsource is a query called "Panel1"
The main id field is called:  "Main_Id_Key"

On page28 of the TabCtl27 I have a subform:
"sp_DefaultSearch subform"
Id field is "[Master Agreement ID_Key]"
Recordsource is "sp_DefaultSearch"

What I need:
If i  double-click on a row in the subform on page28
I need the subform in page29 to filter to the same id # as i double-clicked on in page28


Thanks
fordraiders
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fordraiders

ASKER

ok pat , the subform on page 29 is  "Panel1 subform"

So if i double-click on the subform on page28..
would i not have the code in the double-click event for the subform on page 28..
instead of in the current event ?

Me.parent!sfrmonpage29.form.Requery  would this be:

"Me.parent!panel1_subform.form.Requery"

Thanks
fordraiders
if the name of subform control  "Panel1 subform" have a space on it , you need to enclose them in bracket..

access have a bad habit of replacing the space with an underscore, and raised an error about not finding the control

Me.parent!panel1_subform.form.Requery

should be

Me.parent![panel1 subform].form.Requery
thnx as always
So if i double-click on the subform on page28..
would i not have the code in the double-click event for the subform on page 28..
instead of in the current event ?
Forms don't have double click events.
I use the Current event to sync forms.  When frmA changes records, then I requery frmB.
I use the double-click event when I want to open popup forms.  Interfaces need to be as consistent and logical as possible.    When you use cascading combos, you don't double click on the "master" combo to requery the "child" combo so I don't do it for forms either.

@Rey, it isn't a bad habit, it is Access endeavoring to accommodate the inexperienced developer.  Anyone who has ever programmed knows that variable names cannot contain spaces or special characters (and understands why) and so they wouldn't create objects or columns with those characters but Access serves all levels and in this case, Access substitutes an underscore for every non-acceptable character. It isn't random. it is consistent.  If a user creates a name
45% or $3 minimum
Then Access will convert that to
45__or__3_minimum

Notice that there are two underscores in a row in two places.

Even worse is creating names that Access is going to make identical based on its internal rules.

% Amt
$ Amt

Both of these convert to the same name

__Amt

See how Access likes that!

Bottom line is - just say no to embedded spaces and special characters except the underscore.