Query not working

MadeCurler

enthusiastic pensioner
Local time
Today, 17:43
Joined
Dec 6, 2007
Messages
49
I attach a slimmed down version of a db. When I select a specific "fish type" from the Combo Box on the form, I get the answer I expect. If I select "all fish types" nothing is returned. What is wrong with the onClick code of the command button?:banghead:
 

Attachments

Because you have no fish type = "all fish types" in your table "TblCatches".
You have to change the criteria in the query = "QryFishTypes"
 
Thanks for your prompt reply. Perhaps I'm not explaining myself properly (or don't understand your answer). I have a field "fish type" in TblCatches which is related to another another table "TblFishType" which has 4 records, one of which is "All fish types". When I select "Salmon" on FrmMultiParas the number "1" is passed to the query and returns a list of salmon caught. When I select "All fish types" from FrmMultiParas, "" is passed to the query and I expected to see all fish catches listed.
 
But still you haven't any fish type = "all fish types" in your table "TblCatches", and the query is only retuning results if you have a fish type that is equal to the FrmMultiParas combobox in the table "TblCatches", (not matter if it is number or text).
attachment.php


So you need to modify your query, to get all fishes from table "TblCatches" when "all fish types" is selected in the combobox.
 

Attachments

  • TableValues.jpg
    TableValues.jpg
    28 KB · Views: 275
Last edited:
Thanks again for taking the time to reply at this time of year. I think I get it now. Have a nice Christmas
 

Users who are viewing this thread

Back
Top Bottom