Query By Form Parameter Rejected

Robot2016

New Member
Joined
Feb 3, 2016
Messages
9
I have an Access 2016 database containing names, email addresses and dates of hirers together with how many adults and children there were in the party (0-99). I use a form to enable the user to search by different criteria. All works well with the exception of the criteria for "Children" or "No Children". The field concerned holds a number value equating to the number of children in the party. The form has a combo box posing the question "With Children? Yes or No". If the User clicks "No", I put a "0" in an unbound control on the form. If the user click "Yes", I put ">0" in the unbound control. The form passes it's data to a Query which works fine when "No" has been selected but returns no records when "Yes" has been selected. I have tried formatting the field to Number and to Text but it makes no difference. Can anyone help?
Thank you.
 
The calculation is exactly the same logic and it works perfectly. The original problem with the form looks like an inability to pass the symbols "<>" to the query.
Yeah, I figured that might be the case, but just wanted to see how exactly you were using it/referencing it in your query. Personally, I never use the "Query By Form" option myself, I find it too restrictive. For simple tasks, I may use a Parameter Query, but more times than not, I will have a Form with all my selection criteria, and then use VBA behind the scenes to dynamically write the SQL code I need for my query.
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,215,131
Messages
6,123,223
Members
449,091
Latest member
jeremy_bp001

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top