List Box Command and Filter Criteria

L

Londa Sue

Hello,

I've a list box for which I've multiple filters. I'd like to add another
criterion for one of the filters. Here is the code:

DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*'))
ORDER BY tbl_main.DocumentID"

Along with '*PL*', I'd like to add '*CMP*' so that it gives me both PL and
CMP records. I tried:

DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*' AND
'*CMP*')) ORDER BY tbl_main.DocumentID"

but this didn't work.

May I get an edit on this, please?

Thank you,
 
A

alex

Hello,

I've a list box for which I've multiple filters.  I'd like to add another
criterion for one of the filters.  Here is the code:

DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*'))
ORDER BY tbl_main.DocumentID"

Along with '*PL*', I'd like to add '*CMP*' so that it gives me both PL and
CMP records.  I tried:

DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*' AND
'*CMP*')) ORDER BY tbl_main.DocumentID"

but this didn't work.

May I get an edit on this, please?

Thank you,

air code...

Will this work:
DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) in
('*PL*','*CMP*')) ORDER BY tbl_main.DocumentID"
 
D

Douglas J. Steele

DocList.RowSource = "SELECT ID, DocumentID, DocumentTitle, ReleaseDate,
Version, Valid FROM tbl_main Where DocumentID Like '*PL*' Or DocumentID
Like '*CMP*' ORDER BY DocumentID"
 
G

Guest

Londa Sue said:
Hello,

I've a list box for which I've multiple filters. I'd like to add another
criterion for one of the filters. Here is the code:

DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*'))
ORDER BY tbl_main.DocumentID"

Along with '*PL*', I'd like to add '*CMP*' so that it gives me both PL and
CMP records. I tried:

DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID,
tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version,
tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*' AND
'*CMP*')) ORDER BY tbl_main.DocumentID"

but this didn't work.

May I get an edit on this, please?

Thank you,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top