Re: Specification of multiple link criteria

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



If the ID_CSS value needs to come from from the main form, you could try
this:
stLinkCriteria = "([ID_CSS] = " & Me.Parent![ID_CSS] & ") AND ([ID-Lid]
= " & Me.[ID-Lid] & ")"

Each form has a current record. The value referred to in the statement will
be from the current record of the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"RoBo" <RoBo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9AF7D58D-59AD-400B-83C7-BCEF4785CC69@xxxxxxxxxxxxxxxx
Extra info: The form consists of a main form and a sub form. Both forms
are
based on the same query. Main form "Maintenace CSS" and subform "Selection
CSS".
Field to link: ID_CSS and ID_Lid.
To open the form "Maintenance Lid", I need the ID_CSS from "Maintenace
CSS"
and the ID_Lid from the form "Selection CSS".

Ron

"RoBo" wrote:

The value should match the cursor position of the record selected on
screen.

Ron

"RoBo" wrote:

Hi Allen,

This does not seem to work. In the form in which I select a record (the
form
is based on a query) the [ID_Lid] field contains the value of the first
record of the query. It should contain the value of the selected record
in
that wquery. How do I set the value of the link field to the value
[ID_Lid]
of the selected record?

Ron

"Allen Browne" wrote:

The basic idea is to put the 2 parts together with AND between them.
Brackets are optional, but can help.

This example assumes both fields are of type Number (not Text), and
you have
text boxes on the form that supply the values:
stLinkCriteria = "([ID_CSS] = " & [ID_CSS] & ") AND ([ID-Lid] = "
&
[ID-Lid] & ")"

If it doesn't work correctly, make this the next line:
Debug.Print stLinkCriteria
Then when it fails, open the Immediate Window (press Ctrl+G), and see
what
came out. It has to look exactly like the WHERE clause of a query.
You can
mock up a query putting any values in the Criteria, and swith the
query to
SQL View (View menu in query design) to see the WHERE clause.

If the fields are Text type, you need extra quote marks.

"RoBo" <RoBo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CEB76F35-1E54-4418-8403-73FEDB526202@xxxxxxxxxxxxxxxx
I am having a problem. From a selection from, I display a list of
records
that meet one link field. From the shown list I would like to
select a
record
but this record can only be selected by using two link-criteria
[ID_CSS]
and
[ID-Lid]. How do I specify this correctly in the stLinkCriteria
field?

Thanks for helping me out. in the Dutch forum nobody answered me.


.



Relevant Pages

  • Re: Parameters
    ... I basically have four options in the combo box, can I add an All to that selection or maybe a check box? ... RowSourceType you can add "ALL" to the query by making it a Union query: ... ComboBox drop-down list. ... In the query that is based on the ComboBox the WHERE clause will look ...
    (microsoft.public.access.queries)
  • RE: Designing Query - Help Please ASAP
    ... Paste the above SQL into a new blank query in SQL view and save it while ... "tmdrake" wrote: ... "Ken Sheridan" wrote: ... If I make a selection in the ProjectID box = then the subform will ...
    (microsoft.public.access.queries)
  • RE: Code using list box and multi select option
    ... OK I understand you make a selection in your query that refers to a field on ... once in using the filter in the code. ... Dim strFltr As String ...
    (microsoft.public.access.formscoding)
  • RE: Code using list box and multi select option
    ... I assume you have other selection criteria in the query that also point to ... In your original code, you only had 1 query, the one I told you to change to ... You can simply resolve this by applying the same filter to those reports. ...
    (microsoft.public.access.formscoding)
  • RE: Code using list box and multi select option
    ... the field to just open the query without a selection and use a filter to ... a filter wouldn't work for these purposes. ... OK I understand you make a selection in your query that refers to a field on ... Dim strFltr As String ...
    (microsoft.public.access.formscoding)