Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 650
  • Last Modified:

multiple stLinkCriteria

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
wesellnow
Asked:
wesellnow
  • 3
  • 3
1 Solution
 
shanesuebsahakarnCommented:
Try:

stLinkCriteria = "[Step3]=" & Me![No] & " And [Step2]=" & Me![Yes]
0
 
wesellnowAuthor Commented:
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
 
shanesuebsahakarnCommented:
No problem - don't forget to accept one of my comments as an answer to close this question :)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
wesellnowAuthor Commented:
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
 
shanesuebsahakarnCommented:
stLinkCriteria = "[Step3]=" & "No" & " And [Step2]=" & "Yes AND [StartingPrice]< 9.99"
0
 
wesellnowAuthor Commented:
Thanks for the quick responce.

Mark
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now