Solved

multiple stLinkCriteria

Posted on 2004-09-14
6
594 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
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.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question about DB Schema 27 56
Create macro from runcode 30 26
Binding recordsets to a form 6 27
aggregate query? 20 53
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

822 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