473,402 Members | 2,046 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,402 software developers and data experts.

Form NOT linking to Link Criteria - HELP

I've recently created a form link from a listbox with proper link criteria. However, I had to change a form's property to 'tune' the slow reactions from linked tables over the network (the OnLoad solution and switching controls to Tag functions). This forces me to set the recordsource to Null and doing so, my previous code to automatically link the listbox value (from Form1) to Form2 to be inoperable.

Form1 Control:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_Contract_Entry"

stLinkCriteria = "[Contract_Key]=" & "'" & Forms!main_switchboard.[List11] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Form2 OnLoad Sub
Me.RecordSource = "Contract_Main"

For Each ctl In Me.Controls
Select Case ctl.Properties("ControlType")
Case acComboBox, acListBox
ctl.RowSource = ctl.Tag
Case acSubform
ctl.Form.RecordSource = ctl.Form.Tag
Case Else
'do nothing
End Select
Next ctl

Set ctl = Nothing

Please help - If I remove the OnLoad fix and set the Form(2) with Record Source as Contract_Main, everything works fine...but very slow

PLEASE HELP
Nov 21 '07 #1
3 3465
FishVal
2,653 Expert 2GB
Hi, vbrookie.

DoCmd.OpenForm method sets Form.Filter property before any event (Open, Load) on an opened form will be fired.
You may try to pass LinkCtiteria via OpenArgs and then on Form_Load event set Form.Filter property to Form.OpenArgs.
Nov 21 '07 #2
Hi, vbrookie.

DoCmd.OpenForm method sets Form.Filter property before any event (Open, Load) on an opened form will be fired.
You may try to pass LinkCtiteria via OpenArgs and then on Form_Load event set Form.Filter property to Form.OpenArgs.
Thanks for the tip - however, I'm not sure how to code that...can you help me out?

Thanks!
Nov 21 '07 #3
FishVal
2,653 Expert 2GB
Thanks for the tip - however, I'm not sure how to code that...can you help me out?

Thanks!
Something like this

Expand|Select|Wrap|Line Numbers
  1. Dim stDocName As String
  2. Dim stOpenArgs As String
  3.  
  4. stDocName = "frm_Contract_Entry"
  5. stOpenArgs = "[Contract_Key]=" & "'" & Forms!main_switchboard.[List11] & "'"
  6. DoCmd.OpenForm FormName:=stDocName, OpenArgs:=stOpenArgs
  7.  
Form2 OnLoad Sub
Expand|Select|Wrap|Line Numbers
  1. With Me
  2.     .RecordSource = "Contract_Main"
  3.     .Filter=.OpenArgs
  4.     .FilterOn=True
  5. End With
  6.  
  7. For Each ctl In Me.Controls
  8.     Select Case ctl.Properties("ControlType")
  9.     Case acComboBox, acListBox
  10.         ctl.RowSource = ctl.Tag
  11.     Case acSubform
  12.         ctl.Form.RecordSource = ctl.Form.Tag
  13.     Case Else
  14.         'do nothing
  15.     End Select
  16.     Next ctl
  17.  
  18.     Set ctl = Nothing
  19.  
Nov 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: nectar | last post by:
Hello, In an Offers DB, I have a form with two fields BeginDate and EndDate. When clicking on a button, it opens a continous form with a DoCmd.OpenForm and a criteria based on the 2 dates...
1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
1
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a...
0
by: Steve McLellan | last post by:
Hi, Was wondering whether there's any more info on why the project I'm working on might not be able to link incrementally... as deadlines approach, waiting 3 minutes each link is not what I...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
5
by: EricS | last post by:
Hi, Was wondering if anyone can help. I have multiple queries in a database. The selection criteria for these queries is always a time period I want to do the analysis by. Rather than having to go...
4
by: JPG4 | last post by:
I have tried just about everything that I can think of, so now I turn to you all for help! I have created a form (titled "OAG") with an unbound textbox titled "DOW". I also have a Query that I...
3
by: phil67b | last post by:
Hello everybody, I have a page rech.php where I'm doing a multi-criteria research Ex. choose your car model, choose your country. After validation of my form, on the same page, the lines will be...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.