Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stLinkCriteria Vs "=Forms!formName!refName" 1

Status
Not open for further replies.

marsss

Programmer
Sep 24, 2004
116
US
Hello, i would like to know if there is a gain in speed performance opening a form loading the data for a specified referance using a link to the previous form Vs the stLinkCriteria which look only to filter.

Case #1 :
Code:
stDocname = "formSecondForm"
stLinkCriteria = "refName" = 1
DoCmd.OpenForm stDocName, , , stLinkCriteria

Case #2 :
havinf in Current forma a txtbox named refName having the right value (in this case 1)
Code:
stDocname = "formSecondForm"
DoCmd.OpenForm stDocName
Having in the formSecondForm on load up
refName=Forms!formMain!refName

In case one, do it load up everything then filter, or filter before? Case 2 would make sure not all data load for nothing
Dont realy need t browse between data, juste need the one called in second form

thx for info
 
Edit

case #1 :

stLinkCriteria = "refName = 1"
Or
stLinkCriteria = "refName = " & myVariable

Well, if thread isn t that clear and hard to understand, to make thing short :

Do using :
DoCmd.OpenForm stDocName, , , stLinkCriteria

Make the next form load all data and show only the one going with the filter
OR
Filter data and load up and show only the data going with the filter
 
Case #1 does, indeed, load all the data and then filter it for display. Case #2 only loads the data matching the criteria.

Case #2 is more efficient, especially if your tables are across a network.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Thx RickSprm confirmed what I though
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top