• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 649
  • Last Modified:

stLinkCriteria = "[Clnr]=" & Me![Clnr]

Hi there,

I have this:
    stLinkCriteria = "[Clnr]=" & Me![Clnr]
But I need 2 stLinkCriteria on that line after I do this:
        DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria

So something like:

    stLinkCriteria = "[Clnr]=" & Me![Clnr] And "[Id]=" & Me![Id]
This doesnt work.
Is it posseble what I want? I am I doing something wrong?

1 Solution
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Should Be:

stLinkCriteria = "[Clnr]=" & Me![Clnr] & " And [Id]=" & Me![Id]

Note that is Clnr or ID is a Text field, you'll have to enclose the values in single quotes ( ' ). In the example below, I've added single quotes to both:

stLinkCriteria = "[Clnr]='" & Me![Clnr] & "' And [Id]='" & Me![Id] & "'"

fmewAuthor Commented:
I am learning!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now