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

Posted on 2007-10-02
Medium Priority
Last Modified: 2008-01-09
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?

Question by:fmew
LVL 85

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 total points
ID: 19997409
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] & "'"


Author Comment

ID: 20002188
I am learning!


Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Screencast - Getting to Know the Pipeline

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question