> 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[ at ]discussions.microsoft.com> wrote in message
> news:9AF7D58D-59AD-400B-83C7-BCEF4785CC69[ at ]microsoft.com...
> > 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[ at ]discussions.microsoft.com> wrote in message
> >> > > news:CEB76F35-1E54-4418-8403-73FEDB526202[ at ]microsoft.com...
> >> > > >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.
>
>
>