Solved

multiple stLinkCriteria

Posted on 2004-09-14
6
570 Views
Last Modified: 2008-03-17
I am trying to open a form using two criteria. It works fine with either one, but I am getting a "type mismatch" when I combine the two. I think I am just combining them wrong. Please help.

Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "product_a"
     
    stLinkCriteria = "[Step3]=" & Me![No] And "[Step2]=" & Me![Yes]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Thanks,
mark
0
Comment
Question by:wesellnow
  • 3
  • 3
6 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12059932
Try:

stLinkCriteria = "[Step3]=" & Me![No] & " And [Step2]=" & Me![Yes]
0
 

Author Comment

by:wesellnow
ID: 12060005
Thanks,

Perfect.
I  don't know VB, so I had spent 2 hours on that. I'll be using this site more often.

Mark
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12060026
No problem - don't forget to accept one of my comments as an answer to close this question :)
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:wesellnow
ID: 12060226
More to the question.

This worked, but I need to add another criteria. This last one is a currency field. How do I add this? Need to add:
AND [StartingPrice]< 9.99


Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "product_a"
     
    stLinkCriteria = "[Step3]=" & "No" & " And [Step2]=" & "Yes"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Thanks,
Mark
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 100 total points
ID: 12060232
stLinkCriteria = "[Step3]=" & "No" & " And [Step2]=" & "Yes AND [StartingPrice]< 9.99"
0
 

Author Comment

by:wesellnow
ID: 12060353
Thanks for the quick responce.

Mark
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 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

17 Experts available now in Live!

Get 1:1 Help Now