RE: Query by form problems

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Karl,
I'm a little confused. Should I add a list box next to my current text box
or replace it with a two column list box? Am I using the current query or
does the list box use a query such as you have listed below? Added to its row
source? Could we use a real example, e.g., using the income field in my
tblMembers. The current text box is named WhatIncome and uses the query
"QBF_members_query". Please forgive these basic questions, but I'm new at
this.

Thanks
Robert

"KARL DEWEY" wrote:

I really would like to use boolean operators with this to get maximum
utility from this form.
There is one way I can can think of to do it. Do not enter the '>' or '<'
in the same text box but have a list box with two columns (value & display)
to select from. In the query use both the text box and list box for criteria.

SELECT YourTable.*, [Forms]![YourForm]![ListBox] AS X
FROM YourTable
WHERE (((YourTable.debit)=[Forms]![YourForm]![TextBox]) AND
(([Forms]![YourForm]![ListBox])=1)) OR
(((YourTable.debit)>[Forms]![YourForm]![TextBox]) AND
(([Forms]![YourForm]![ListBox])=2)) OR
(((YourTable.debit)<[Forms]![YourForm]![TextBox]) AND
(([Forms]![YourForm]![ListBox])=3));

List box default to 1 for = (equal); 2 for > (greater than); and 3 for <
(less than). You can have more selections such as >= and <= byt using more
numbers.
--
KARL DEWEY
Build a little - Test a little


"rpbsr" wrote:

I've run across a great QBF technique in Microsoft "Help and Support"
(Article ID: 304428). It uses the following general query criteria:

Forms!FormName!ControlName Or Forms!FormName!ControlName Is Null
and also:
Between Forms!FormName!StartDate And Forms!FormName!EndDate Or _
Forms!FormName!StartDate Is Null You can use this criteria statement to
query a date field by using Start Date and End Date

My text data type fields in the form produce expected results. Two numeric
fields
(age & income) produce results as expected, but cannot use boolean
operators, e.g., > in the form. I get an error "The value you entered isn't
valid for this field..."

I have one numeric field (family size) that returns all records, regardless
of the number I put in the form field.

I really would like to use boolean operators with this to get maximum
utility from this form.

Appreciate any help on this.

Thanks.


.



Relevant Pages

  • RE: Filtering a subform using many combo boxes
    ... SELECT AssignedPriority, AssignedPriorityDetail FROM tblAssignedPriority ... YES for all of the combo boxes.) ... I followed you instructions to the letter and every one of the criteria ... open the query "qryProjects" in design view. ...
    (microsoft.public.access.forms)
  • Re: using a form with combo box to input criteria
    ... Candia Computer Consulting - Candia NH ... When you removed the criteria, ... Then your criteria in the query would be... ... query behind your main report. ...
    (microsoft.public.access.forms)
  • Re: using a form with combo box to input criteria
    ... Candia Computer Consulting - Candia NH ... When you removed the criteria, ... Then your criteria in the query would be... ... query behind your main report. ...
    (microsoft.public.access.forms)
  • RE: Filtering a subform using many combo boxes
    ... I followed you instructions to the letter and every one of the criteria ... I described the typical properties of all my combo boxes in my original ... open the query "qryProjects" in design view. ... I have a main table named tblProjectData that contains all the data for each ...
    (microsoft.public.access.forms)
  • Re: using a form with combo box to input criteria
    ... When you removed the criteria, ... Then your criteria in the query would be... ... query behind your main report. ...
    (microsoft.public.access.forms)