Query Criteria True/false Field

Apr 25, 2006

I'm trying to limit the records on a subform via an option group selection. The group has 2 options: optionTrue (option value = 1) and optionFalse (optio value = 2). I have the following code in my query criteria of the true/false field.

IIf([Forms]![FrmHome]![frameProcessed]=1,-1,0)


The false part works, but the true part doesn't. I've tried many variations using true/false, using checkboxes, etc. and nothing works.

The database is SQL Server if that matters.

Any suggestions?

Also, is their a way to have an option for True or False or ALL?

Thanks,
Sup

View Replies


ADVERTISEMENT

Queries :: Return Records If One Field Is True And Another False

Jul 23, 2013

I am trying to create a query pulling from several tables. I will use the example below to illustrate what I'd like to do.

I have a field called 'Acc_Num', one called 'Stat_Code', and a third called 'Cat_Code'.

Each 'Acc_Num' can have multiple records because there are multiple Stat_Code and Cat_Code values.

What I want to do is isolate just the Acc_Num records where Stat_Code = 1 and Cat_Code equals A1.

I also want to isolate the Acc_num records where the Stat_code = 1 and where Cat_code does not exist.

View 7 Replies View Related

General :: Determine Value Of Any Field Based On True And False Statement

Aug 5, 2013

In a form, the value of any field may determine if the other field will be true or false. For example in my form, inventory, if value in code is equal to 2 then the Field Table will be automatically false.

View 12 Replies View Related

Forms :: True / False - Form Properties Based On Field Value

Sep 10, 2014

On my form ECOs

When my text box RELNUM is > 0 I want form properties AllowEdits set to FALSE.

When RELNUM is null I want form properties AllowEdits set to TRUE.

This must be possible, but not entirely sure where to start.

Since I can scroll through records in this form I'm thinking I have to put an event in ON LOAD, bbut beyond that I'm at a lost.

View 11 Replies View Related

True Or False Query Issue

May 12, 2006

I have a query that shows banned users (I work in a school). When a student's ban has ended, a tick box is checked in a form linked to tblBannedUsers to show they are no longer banned.

The query itself simply queries all records in tblBannedUsers with a username field (UserID) taking search criteria from a box on a form.

However, I want to filter out the students that are no longer banned (those with a tick in the checkbox). To do this, I thought it would be a simple case of editing the query, and in the Ban Lifted field criteria, use =False to say I only want those records with a tick.

This doesn't work and I still get all records given the combo box filter (which are just filtering for a username...if I leave it blank it gives all records via Is Null).

What should I be putting in the criteria to filter out those records with a ticked checkbox?

Thanks,

Steve Swallow

EDIT: I've just done a test query and <B>No</B> is the criteria to use, but when I use this criteria in my query which also take data from a form's combo box it ignore the <B>No</No> criteria.

View 4 Replies View Related

Reports :: Change Font Color Based On True / False Value Of Another Field

Jun 28, 2013

In access report, I'm trying to change color of text in specific records based on the true/false value in another record. Works in forms using conditional formatting, but won't seem to work in a report.

Here's what works in forms : IIf([2009 Symposium]=true, forecolor=255 ....this changes the records to red.

But using the same expression in a report doesn't change the text color.

View 2 Replies View Related

Returning True/False To A Form When Query Is Run?

Mar 9, 2007

I'm really not sure how to go about this. I'm creating a course booking system and when creating a booking I need to check for current bookings with the same employee and course id's (i.e. the employee is already booked on the course). The query takes the employee and course id's from a form, and is initialised when the 'book' button is pressed. It correctly selects if the person is already booked on the course but I want the query to return a value to the form i.e. if it returns null/false then the booking can be created but if it returns a record/true then the booking already exists and a message box can be displayed.

I'm not sure if I'm going about this the right way, can anyone suggest how this can be done as described above or suggest a better way of doing the task?

View 5 Replies View Related

Filter On A Form True/false/neither

Jun 2, 2006

Is it possible to filter a forms records by using a boolean True/False field.
I want to show all current records for option 1, Expired records for option 2, and all records for option 3. The form is based on 'tblMembers' which has a field [Expired] which is a boolean yes/no field formatted to true/false.

View 1 Replies View Related

Modules & VBA :: Sum Up 10 Columns For Same Row Of True / False

Sep 19, 2014

There are around 100,000 records to update. Would a SQL Statement be more efficient?

It is a local table being used to sum up the results of a handful of rules.
The columns can only hold True or False (datatype)
If and only if all columns are True - then true

MyRow T T T T T T T T T T - Sum in next column is T
MyRow T T T T T T F T T T - Sum in next column is F

Speed is very important. The Recordset for a single row is still open on the Currrent Record since the Update just finished.

Code:
RS_RE_1SegStatusProfiled.Fields("Total") = (RS_RE_1SegStatusProfiled.Fields("RE_1") AND CStr(RS_RE_1SegStatusProfiled.Fields("RE_2") AND (RS_RE_1SegStatusProfiled.Fields("RE_3") ' and so on

My guess is that since the recordset is open to the current record on a local table, it will be efficient to just re-read all of the values and And them together.

Since I have code writing to each record, I could also go through all the extra assignment of a local variable.

View 4 Replies View Related

Show If False But Wont Let Me Make It True

Sep 16, 2005

I have a form that shows the records found in a query if the completed tick box is false. this is fine, but i have also put the tick box on the form, and wish the user to tick it when they are done how ever they, get a beeping error and wont let you change it to true. Can anyone suggest the resolutoin for this.

View 2 Replies View Related

Option Group With True Or False Values

Jul 3, 2006

I want to create an opion group with two rad buttons in it. The values of those button wont be values but as true or false in order to use it in another text box to performa calculations. EX.

=IIf([radNew],"Hello",IIf([radUsed],IIf([txtAgeofCar]<184,[txtExciseinTotal]=Null,IIf([txtAgeofCar] Between 185 And 365,[txtExciseinTotal]*(-0.15),IIf([txtAgeofCar] Between 366 And 1095,[txtExciseinTotal]*(-0.2),IIf([txtAgeofCar] Between 1096 And 1825,[txtExciseinTotal]*(0),IIf([txtAgeofCar]>1825,[txtExciseinTotal]*(0.25))))))))

As you can see radNew and radUsed are the Options Buttons. Its not working in an option group.

Thanks in advance

View 2 Replies View Related

Checkboxes True/False -1/0 ... Lost In Translation

Mar 15, 2006

Hi all,

My client has an Access database where the value of a checkbox is stored in a field called Exclude_PropCount as -1 or 0. I am trying to get this form working online, but have been unable to successfully store this value in the db. I have set up a simple page to test it, and my relevant code is this:

sql_save = "INSERT INTO HVM_Data (VC, Exclude_PropCount) VALUES ('a9', '-1')"

con.Execute sql_save

set duplicateVC1 = db.Execute("SELECT Exclude_PropCount FROM HVM_Data WHERE VC = 'a9'")

response.write duplicateVC1("Exclude_PropCount")

But no matter whether I have '-1' or '0' in the INSERT statement, the response.write line always returns "False". And of course I've tried inserting "true" and "false", but it only accepts an integer.

As exceptionally bad timing would have it, my server is slightly fubar and I can't download the database to my PC to see what's actually being stored there, but looking at the above code, do you see anything I'm doing inherently *wrong*? This is my first time with checkboxes so I won't be surprised if that's the case. Hints?

Thanks!

View 1 Replies View Related

General :: Exporting Table - Yes / No Instead Of True / False

Aug 2, 2012

Using DoCmd.TransferSpreadsheet I'm exporting a table which has a couple of Yes/No fields formatted as Yes/No. However when I export, they appear as TRUE/FALSE? Am I doing something wrong?

View 3 Replies View Related

IIF Statement Returning Same Result For True And False?

Jan 10, 2012

I've built an IFF expression that is determined by a number of variables.

If any of the Data fields are filled I want the statement to return true.

If NONE of the four are filled in I want it to return false.

As it is, it returns true no matter what.

Here is the expression I'm using:

Title: IIF (IsNull([Data1] and [Data2] and [Data3] and [Data4]), True , False)

View 7 Replies View Related

Make Column Show True False In Table

Jun 19, 2014

Can make a column show true or false in a table when two other columns in the table match each other? I think the statement would be like this:

If([Column1] = [Column2], True, False)

The only problem I am having is that I don't know if it can work in a table or does it just have to be in a query?

View 8 Replies View Related

Queries :: IIF Statement With Comparison Operators In True And False Parts

Oct 2, 2014

I have a report where my customer wants to be able to input a value and then be able to select whether the report shows values above or below that value. I have a combo box that has 2 values (1=Less than or equal to, 2=greater than or equal to). There is a text box where he inputs the rate to compare against (e.g. $75). When he hits submit, the application stores the values of the combo box and text box into global variable and then I have a public function that can be used to retrieve the values. GetHRate() gets the value to compare against and GetHRateCompare() gets the value to indicate <=(1) or >=(2).

In my query for criteria for rate I have this expression:
IIf(GetHRateCompare()=1,"'<=",">=") & GetHrate()

I've tried every combination of double quotes, single quotes, no quotes moving the GetHRate inside the IIf statement and nothing seems to work.

If I just hardcode <=GetHrate() into the criteria it works perfect but that does not achieve my goal of letting him select over/under at run time. Here's the full query:

SELECT qryCustomers_AverageTimeByScheduleID.ServiceName, qryCustomers_AverageTimeByScheduleID.ScheduleID, qryCustomers_AverageTimeByScheduleID.SumOfTotalTim e, qryCustomers_AverageTimeByScheduleID.PropertyID, qryCustomers_AverageTimeByScheduleID.PropertyName, qryCustomers_AverageTimeByScheduleID.MonthCount, qryCustomers_AverageTimeByScheduleID.AverageTime,

[Code] ....

View 2 Replies View Related

Appending Leading Zeros By If Statement With Formulas For True And False In SQL

Jul 15, 2014

My first question is how do I append 00001 so I can have a value for the false side of 9123400001 instead of 912341...My second question is why does it prompt me to enter parameters? It also produces all false values from the if statement...What I am trying to do is use a column that has either a Y or a N and using the if statement to correspond with different formulas depending on the Y or N.This what I have so far.

SELECT
IIF (ISRAILROAD=Y,9 & UCN & TXRTAREA, 9 & UCN & 00001 )
FROM CombinedUtility;

View 5 Replies View Related

How To Set Up An Error Message If Criteria Is False In A Query ?

Aug 9, 2005

How to display an error message if the specified criteria is false in a query?
what function should be used for that?

I have a query which has to check 3 conditions and if the 3 conditions are true then it should display an error message.

What should be done for that?

View 1 Replies View Related

Queries :: Multiple Query Criteria IIF Statement - True Condition

Feb 24, 2015

I'm trying to have a single or multiple query criteria based on what the user checks on a form.

I can't get the True condition to work at all, I get no records. Here is what I'm using

IIf([Forms]![FrmAttendanceLogsRpt]![BlkFilter]=-1,[TempVars]![EID] Or 86,[TempVars]![EID])

If I just put
[TempVars]![EID] Or 86
in the Criteria it works just fine.

View 14 Replies View Related

Reports :: Exclude Individuals From False List If They Are In True List

Jul 15, 2013

I have created my tables and form and am now trying to run reports to organize the data. I have figured out how to group the individuals by group and treatment, but can't figure out how exclude individuals from the final list if they are already in another. As background, some of the individuals are eventually excluded from the experiment, though I keep the initial data. When the exclude individual checkbox is checked ("True" on the report) I do not want the individual to be listed in the "False" list, even though there are entries for that individual when that checkbox wasn't checked (when it was "True"). This is so I can get an idea of the current totals in each group.

Implant Period
>Treatment
>>Exclude individual?
>>>Individual ID

I feel like this should be a fairly simple task, but I cannot figure it out... Maybe there is coding to exclude individuals from the "False" list if they are already listed in the "True" list?

View 4 Replies View Related

Open Query If Field Is True

Jun 6, 2006

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View 1 Replies View Related

Open Query If Field Is True

Jun 6, 2006

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View 1 Replies View Related

Open Query If Field Is True

Jun 6, 2006

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View 3 Replies View Related

Make Field True If Other Field Is Null

Jul 10, 2005

Is there an expression in a query, that if want to say, if one field is not null make another field say true?

View 2 Replies View Related

Setting Table Field To True When Exporting To Csv

Sep 21, 2006

Hi,

I export a query as csv to upload to another database on a web site. When that csv file has been exported I'd like the query to be emptied, so that the next time I export I don't export duplicates. What's the easiest way to do that?

I've been thinking of having a field in the table with a check box that is checked when the file is exported. The query then selects only those records where that box is not checked.

But how can I check those boxes on Export rather than when I run the query? The reason being that I may want to preview by running the query, without having that affecting the check box.

View 1 Replies View Related

DSum Data In Subform For A Particular Field If TRUE

Jul 19, 2015

I have a from which has a sub Form in it which uses a query of a table which is filtered, In the main form I want a sum of the data in the subform for a particular field if TRUE.

In the main form I have a text field with the Syntax =DSum("[Cost]","RepairInformation","[Labour] =.True."), but this returns an error, I have no issues for the total cost for with I have a Text Box in the subform which returns the Total cost in the main form.

What are my options to have a conditional sum for a particular condition.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved