New User Query Question - really need some help!!

G

Guest

I have a simple data base that tracks our packs of timber stock at a sawmill.
Each pack is it's own entry line in the database.
The first colum in the data base is called "Status". The packs can either
be, Stock, Sold or Despatched and are changed manually from stock to sold or
despatched as they reach this status.
I have a query on this database that I have entered in the criteria section
the expression [ENTER STATUS]. When prompted I can type in Stock, Sold or
Despatched and it returns the results. What I want it to do is change the
expression so if I leave this prompt blank and just hit enter then it shows
me all the entries in the database. At the moment if I leave it blank nothing
is returned.
So basically to sum up I can enter the status I want to see and it shows me
that or I leave it blank and the default is it shows me everything

Can anyone please help me write the expression I need. I have been trying
for three days with the expression builder and just can't get the result I
want.

Thanks from New Zealand
 
G

Guest

Try something like

SELECT TableName.Status
FROM TableName
WHERE TableName.Status=[ENTER STATUS] OR [ENTER STATUS] Is Null

Use the Criteria as a field with an Or condition for been Null
 
G

Guest

Thank you, Thanks you - works perfect
Really appreciate the help
JohnG
--
JohnG


Ofer Cohen said:
Try something like

SELECT TableName.Status
FROM TableName
WHERE TableName.Status=[ENTER STATUS] OR [ENTER STATUS] Is Null

Use the Criteria as a field with an Or condition for been Null
--
Good Luck
BS"D


JohnG said:
I have a simple data base that tracks our packs of timber stock at a sawmill.
Each pack is it's own entry line in the database.
The first colum in the data base is called "Status". The packs can either
be, Stock, Sold or Despatched and are changed manually from stock to sold or
despatched as they reach this status.
I have a query on this database that I have entered in the criteria section
the expression [ENTER STATUS]. When prompted I can type in Stock, Sold or
Despatched and it returns the results. What I want it to do is change the
expression so if I leave this prompt blank and just hit enter then it shows
me all the entries in the database. At the moment if I leave it blank nothing
is returned.
So basically to sum up I can enter the status I want to see and it shows me
that or I leave it blank and the default is it shows me everything

Can anyone please help me write the expression I need. I have been trying
for three days with the expression builder and just can't get the result I
want.

Thanks from New Zealand
 

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