Solved

multiple stLinkCriteria

Posted on 2004-09-14
6
578 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

948 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

20 Experts available now in Live!

Get 1:1 Help Now