Solved

Access Expression Builder - Like & Not Like

Posted on 2011-09-19
3
604 Views
Last Modified: 2012-06-21
Hi there,

I have the following scenario going in expression builder.

I want to sort a column for certain strings (say type 'A') but not for 'B'

The current formula I have is not working

Like (getstring([Forms]![Input]![txt1]) & "*") not like (getstring([Forms]![Input]![txt2]) & "*"

Open in new window


Any help is much appreciated!
0
Comment
Question by:Shanan212
  • 2
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 36560638
try


Like (getstring([Forms]![Input]![txt1]) & "*") AND not like (getstring([Forms]![Input]![txt2]) & "*"
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 500 total points
ID: 36560645
or this




[FieldName] Like (getstring([Forms]![Input]![txt1]) & "*") AND [FieldName] not like (getstring([Forms]![Input]![txt2]) & "*"
0
 
LVL 13

Author Closing Comment

by:Shanan212
ID: 36560728
You just saved me a whole lot of time by switching to Expers Exchange!

Cheers!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

708 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

13 Experts available now in Live!

Get 1:1 Help Now