Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2006, 09:38 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default stLinkCriteria - Multiple Criteria

I am trying to open a form that has to meet two criterias. One is simple and the other is a bunch of or statements. Here is the code that I thought should work but I keep on getting an error. Is it a syntax problem?

stLinkCriteria = "([Mill 1] = '" & txtMill.Value & "' Or [Mill 2] = '" & txtMill.Value & "' Or [Mill 3] = '" & txtMill.Value & "' Or [Mill 4] = '" & txtMill.Value & "' Or [Mill 5] = '" & txtMill.Value & "' Or [Mill 6] = '" & txtMill.Value & "' Or [Mill 7] = '" & txtMill.Value & "' Or [Mill 8] = '" & txtMill.Value & "' Or [Mill 9] = '" & txtMill.Value & "' Or [Mill 10] = '" & txtMill.Value & "') And ([Stage] = '" & StageHidden & "')"

Please help!
andy
 
Old September 8th, 2006, 10:02 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Figured it out myself....

stLinkCriteria = "([Stage] = '" & StageHidden & "' And [Mill 1] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 2] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 3] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 4] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 5] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 6] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 7] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 8] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 9] = '" & txtMill.Value & "') Or ([Stage] = '" & StageHidden & "' And [Mill 10] = '" & txtMill.Value & "')"






Similar Threads
Thread Thread Starter Forum Replies Last Post
IIF multiple criteria stealthdevil Access VBA 10 November 28th, 2007 11:37 AM
Multiple Search Criteria in a Form tet Access VBA 5 October 27th, 2007 08:54 AM
Multiple criteria for a Report stealthdevil Access VBA 33 June 8th, 2006 10:38 AM
Criteria query with multiple fields penta Access 8 October 25th, 2004 11:54 AM
multiple stLinkCriteria? universal Access VBA 1 January 31st, 2004 02:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.