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

Posted on 2007-10-02
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 84

    Accepted Solution

    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

    I am learning!


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    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.…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now