Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB Data Results

Posted on 2008-10-02
5
Medium Priority
?
264 Views
Last Modified: 2013-12-25
CMDString = "select DisplayName from vwSSO where SiteLocation = '" & HSite.Value Or Hall.Value & "'"

When I run my app. the fields are empty. Should I be closing my statement any different?
0
Comment
Question by:devweez
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
JMT116 earned 1000 total points
ID: 22626799
I think your cmd string should look like
CMDString = "select DisplayName from vwSSO where SiteLocation = '" & HSite.Value & "'  Or SiteLocation = '" & Hall.Value & "'"
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 1000 total points
ID: 22626828
or it can be:

CMDString = "select DisplayName from vwSSO where SiteLocation in ('" & HSite.Value & "', '" & Hall.Value & "')"
0
 
LVL 3

Expert Comment

by:JMT116
ID: 22629310
You use of in would achieve the same thing as using multiple or statements, but has the advantage of being more concise.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

885 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