Solved

resetting the master child  links in the right place

Posted on 2016-07-15
7
30 Views
Last Modified: 2016-07-15
access 2010  vba.

When i open a bound form,
I have a subform that i'm resetting the master child source to  ""

Forms!frmMainDataEntry![SapData subform].LinkMasterFields = ""
Forms!frmMainDataEntry![SapData subform].LinkChildFields = ""

I'm doing this to see the subform , initially on startup,  to see all the records in the subform.

What I need:
I have a textbox that I'm using to search into the subform.

I then need to reset the subform to the original settings when a person starts to type in the textbox:
I just dont know what property is the best to do this and when.

 Forms!COSTRECOVERY_MAINFORM![WR294_GRIDVIEW subform].LinkMasterFields = "Search_Term_Holder"
 Forms!COSTRECOVERY_MAINFORM![WR294_GRIDVIEW subform].LinkChildFields = "Customer Name"

i TRIED THE TEXTBOX before update event but i keep getting an error.
0
Comment
Question by:fordraiders
  • 4
  • 3
7 Comments
 
LVL 26

Expert Comment

by:Nick67
ID: 41713025
to the original settings when a person starts to type in the textbox:
I don't know that that is REALLY what you want, and the correct description of when
BUT...
If that is truly correct then GotFocus() is your baby.

If what they are typing in needs to be complete and important, then you have one good choice and one necessary evil.
The good choice is AfterUpdate() which happens when they LEAVE that field -- and sometimes that takes a button or some setup to MAKE the user leave the field.
The necessary evil is if you DON'T or CAN't make them leave the field.
Then you need a Change() event that looks at the sting as they type it in, one character at a time, and does stuff when a valid string (or partial string) is completed by the keystroke just registered.
0
 
LVL 3

Author Comment

by:fordraiders
ID: 41713033
NICK67,
"The necessary evil is if you DON'T or CAN't make them leave the field.
Then you need a Change() event that looks at the sting as they type it in, one character at a time, and does stuff when a valid string (or partial string) is completed by the keystroke just registered."

This is exactly my intention.
the problem is the requery takes along time.

These folks want to see all the records before doing any searching.
I just need to reset the link once to initiate the search. and relink. somehow.

fordraiders
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 41713050
I would look at a little legerdemain then.
These fools want to see all the records first, and then see the bound subform, correct?

I would try putting TWO subforms on the form.
One right on top of another.
One unbound.
The other bound.

When they do the thing that signals they are done with the unbound one, you make it Visible = False and the bound one Visible = True.  And vice versa.

Then you aren't waiting on any kind of requery.
It's worth exploring for feasibility
Change() events are a bitch, and you REALLY want to avoid going there.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 3

Author Comment

by:fordraiders
ID: 41713053
very good..razzle dazzle is my thinking also.
thanks..!!
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 41713104
thnx
0
 
LVL 26

Expert Comment

by:Nick67
ID: 41713140
Did that behave well for you?
It struck me as a good way to get after it, but that doesn't necessarily mean it was good :)
0
 
LVL 3

Author Comment

by:fordraiders
ID: 41713141
It was a good suggestion
Yes
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How Can I Grab This Information off a PDF Form 23 49
Access Crosstab Query with Multiple Values 4 32
Dlookup MSACCESS 5 25
Need help constructing a conditional update query 16 47
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question