Queries :: 2 Checkboxes In A Form - Criteria To Be 00 Or 01 When Cost Checked

Nov 10, 2014

So I have 2 checkboxs in a form. Future cost and LRM cost.

When future cost is checked, I want the criteria in my make table query to be 00, when LRM cost checked, I want the criteria to be 01.

But the problem is when they are both checked I can't get 00 or 01 at the same time.

I have tried different ways but none of them seem to work because with IFF, can only return one value.

I have tried to put the 2 iff in criteria and the or criteria below it exceeds the max time.

The criteria I have right now is:

IIf([Forms]![TPTC Analyzer]![P Future cost]=True And [forms]![TPTC Analyzer]![P LRM cost]=False,"00",
IIf([Forms]![TPTC Analyzer]![P Future cost]=False And [forms]![TPTC Analyzer]![P LRM cost]=True,"01"))

View Replies


ADVERTISEMENT

Queries :: String (via Non-visible Textbox) From Search Form As Criteria Using Checkboxes

Mar 11, 2014

I have an unbound form (named frmReportSearch) with unbound text & combo boxes providing the criteria for a query (named qSeqStreets). The form / query utilize 4 optional fields as search criteria plus date from / to. The results are returned via a report (named rptSeqStreets). The whole operation worked perfectly, however I realized I needed to change one of the criterion to a multivalued field. The change in the table (named Tasks) worked perfectly. I used three checkboxes (named chkA, chkB and chkC) to allow the user to select any combination of the 3 choices, including none (to be treated as no filter on [fldShifts]).

The three options in the field (named fldShifts) are "A" "B" and "C". I am able to manually run the query from design view by typing in the criteria "A" Or "B"... "A" Or "B" Or "C"... and any combination of the three options in the criteria box and running the query. I am using the following code under the OK button's OnClick. The Code below has other items related to all the options .... I didn't want to give partial code so you may understand better:

Code:
Private Sub btnOK_Click()
Dim strShift As String
Dim strA As String
Dim strB As String
Dim strC As String

[Code] .....

My problem is that the query criteria needs to be entered into the criteria box with quotes and separated by "Or" depending on if multiple checkboxes are selected.

I can get the results to show correctly in the textbox, however I imagine the query is adding an extra set of ""s to the string so rather than "A" Or "B" .. it is getting ""A" Or "B"". My query Sql and even design mode are pretty complex, so I wouldn't know how to use the sql in VBA without blowing some fuses.

View 1 Replies View Related

Counting Checked Checkboxes In A Report

Nov 1, 2004

I have a report, where some features are listed as checkboxes. I'd like to have all checked checkboxes counted at the end of report. I've created text field. What shuold be the command in it ? (to count only checked boxes).

Thanx for any help

View 1 Replies View Related

Modules & VBA :: Checking Whether Checkboxes Have Been Checked?

Dec 17, 2013

I'm trying to write some simple code to see whether two check boxes (named cbM001 and cbM011) have been checked and if so, then send out an error message. So far I have tried:

If cbM001 Is False And cbM011 Is True Then
MsgBox "M011 cannot be selected unless M001has also been chosen."
Exit Sub

[Code].....

With this I get "Run-time error 424: object require"

View 6 Replies View Related

Queries :: How To Get Only Yes Checked Box

Aug 13, 2013

I created a table (contains ID, Name, almost 20 yes/no checkboxes).

I need to create a query where i specify the ID and it returns the id, name and all the yes checkboxes.

What I got is all the check-boxes yes and no.

View 6 Replies View Related

Queries :: Find Cost At Time Of Order?

Jan 27, 2014

I have stored the costs in my database with a date they apply from so I have a series of costs which I can then refer back to using the order date to see what cost I should use at any one time. My table structure is as follows:

Code:

tblExtruderCosts
ExtruderID PK - identifies the extruder
FinishID FK - identifies the finish
Cost - the cost for that finish from that extruder
DateFrom - the date the cost applies from
tblExtHead
ID PK
ExtruderID FK
FinishID FK
Orderdate

View 5 Replies View Related

Queries :: How To Create Total Cost Field

Oct 27, 2014

I have a table called Price list, and in it I have two fields, one called Service and The other called cost. The services are listed and their matching prices are listed beside.

In another table called appointments, when making an appointment, I have linked the information so that I can choose from a dropdown from the price list table, under Service type.

I need to be able to create a receipt for the appointment. How can I do that in a query format?

View 1 Replies View Related

Queries :: DLookUp To Identify Base Cost Of Show

Feb 5, 2015

I have a table that holds information for a type of show and the base cost of the show. I am trying to make a query that gathers information for all the shows in the table and uses the Dlookup function to identify the base cost of that show. This will in turn be used in the same query to create a quote, but I can not get the Dlookup function to work and I am sure that I may be doing it very wrong.

The table is called ShowList. That table contains 3 fields, ID, Show Type, and Cost.

The query is called Venue Cost and will have a series of fields that work to develop some math on all items from another table called Venue Info. Venue Info uses ShowList to select the type of show.

What I want the query to do is look up the Show type from VenueInfo and then look up the base cost of the show type from ShowList. What I have been using is not working but is as follows:

DLookUp("Cost","ShowList","[Cost] =" & "[Venue Cost]![Venue Type]")

View 4 Replies View Related

Queries :: Set Bit Field To Default Checked?

Jul 11, 2014

I have a query that simply pulls back each tenant from a tenant table. Each row has a bit field that I use for check box's. This check box is true or false depending on the balance they owe. I currently use it to print off late reports and people that have this field set to true have a check box that auto populates on my datasheet.

I copied the query but I want to change it a little. I want to be able to show all tenants, but I want the bit field to show on my datasheet defaulted to checked for everyone (even if the table shows false) so that I can print all tenants without having to check the fields that are false in my table.

I tried to create an expression instead of using the bit field, but I no longer have the option to make that column into a "Check Box" under Lookup-Display Control.

View 9 Replies View Related

Queries :: Material Checked Out And Returned Products

Apr 8, 2013

Finally got my DB straight so I am not using calculated fields however can't figure out the best way to handle the Combo Box so I do not show closed records ( Item checked out and item returned).

Please see the attached table of materials checked out and materials returned. How to setup a query so that if an item has been returned and matches the item checked out, Both the original check-in and the matching return records are filtered and not displayed in the Combo Box.

Also, I am a little worried about partial returns as when an employee only returns half the amount.

View 14 Replies View Related

Deleting Records That Have Been Checked Or Adding A Record After A Checked Record

Jul 20, 2005

Hi,

I was wondering how to delete records that have been checked (through a checkbox) in a form...

Also, I want to add a record after the record that has been checked. I only want this ability to add records available if only one record is checked. Otherwise, if more than one record is checked, the "Add Record" button would be disabled.

Any help would be much appreciated.

TIA.

View 10 Replies View Related

Calculating Line-Item Cost In Form

Oct 11, 2006

I am having trouble calculating a field in a table and on a form.
I have the following Tables
CUSTOMER: Customer No, Name, Address, City, State, Zip, Discount, Phone, Fax, Contact Person.
ORDER: Customer No, Order No, Order-Date, Delivery-Date.
ORDER LINE: Order No, Product No, Quantity Ordered,
line-item-cost
PRODUCT: Product No, Description, Price, Product Image.

I need to calculate the line-item cost and need it to update every time the user enters a new Quantity ordered on the ORDER LINE form.
I know its (Quantity Ordered*Price)-(Price*Discount) and I did this is a query and it worked but I need it to update in the form and update in the table not the query. I have tried everything (Macros, Queries, and Formulas) and I just can not get it to work.
Does anyone know how to do this?
Thanks

View 1 Replies View Related

Forms :: Making Textbox Visible On A Form If Checkbox Is Checked On Same Form

Aug 30, 2013

I am having a problem with making a textbox visible on a form if a checkbox is checked on the same form. I have done research on this site and have written the code below, but I am getting a Syntax error, see yellow highlight.

- My checkbox is named: Case is a Readmission from WRCA IP to WRCA IP
- My textbox is named: Date of Current IP Admission (I have defaulted this textbox to not visible).

Here's the code I have written:

Private Sub Case_is_a_Readmission_from_WRCA_IP_to_WRCA_IP_Clic k()
If Case is a Readmission from WRCA IP to WRCA IP =true then
Date of Current IP Admission.visible=true
Else
Date of Current IP Admission.visible=false

[Code] .....

View 14 Replies View Related

Forms :: Summing Up In Continuous Form - Total Sell And Cost Value

Sep 8, 2014

I'm adding to a DB which has been working well for a while.

I have a continuous form which has a query behind it. The query takes two values: (For example)

[LineCost] and [LineQTY]

Inside the query, we use the expression TLC: [LineCost] * [LineQTY]

I need to sum this so a Sale with several lines gives me the total sell and cost value.

If you look at the sfrmEditQuote - you'll see the exact same method - working. sfrmEditSale is direct copy of this form, with some changes here and there. But can I get past the dreaded #error? Nope.

I've tried renaming the fields and text boxes, checking the query, but I keep getting #error on the sfrmEditSale form footer.

I have attached the DBs in old and new format.

View 14 Replies View Related

Checkboxes And Queries

Jan 7, 2005

Bit of a novice here...please help!

I have a table listing product # follwed by 12 different bullet points (all text fields). Each bullet field has a corresponding checkbox field stating whether that item should be deleted or not before it is posted to the server. If the item is marked for deletion, the next bullet point needs to move over to the field, leaving no null fields for the final result. Following? I hope so. In addition, some of the bullet fields are currently null and need to be deleted as well. I'm pretty good with designing select queries and basic stuff and I know a little SQL, so any help is greatly appreciated.

View 1 Replies View Related

Forms :: Open Another Form If Checkbox Is Checked?

Apr 7, 2013

I am trying to write an IF statement as a macro on the OnClick property of a checkbox and can't get it to work. Basically, if the checkbox is checked (for Yes) I want it to open another form. (The checkbox is a field on a subform on a form).

I haven't even gotten this far yet, but I would also like the IF statement to include an AND somehow....in other words I want the IF statement to basically say if the box is checked for yes AND the offer status field ="Accepted", then open another form. If either is False, then I don't want it to do anything except display a message box saying they can't initiate a contract is both conditions aren't true.

View 2 Replies View Related

Queries :: Checkboxes Becoming -1 And 0 In Union Query?

Oct 11, 2013

After putting in fields there were checkboxes into a Union Query, they now show up as -1s and 0s. Is a -1 a blank, and a 0 checked?

View 1 Replies View Related

Modules & VBA :: Using Check Box On A Form To Filter Out Results From A Table That Is Checked

May 23, 2014

I have kept the names as simple as I can for the example sake to which I can substitute my names in after.

I have a split form - form1, I have a check box on this form - checkbox1 - That I would like to use to make only the checked results from the table - table1 - show and if it is not checked to show all the results. How would I go about doing this? The table field is called field1.

View 6 Replies View Related

Queries :: View Unchecked Checkboxes In Query

Jun 13, 2013

I only want to view unchecked boxes in my query. What I can tell you is that I used most of what I could find on google like false/ 0/ Where [fieldname] = False/ and some others but I'm having no luck. This is a yes/no field with checkboxes.

View 4 Replies View Related

Queries :: Keyword Search - Find Field Names Of True Checkboxes

Jul 10, 2013

I've recently finished constructing a database that uses forms with checkboxes i.e. when a user opens a form there are several checkboxes associated with labels, but the table only stores the check-boxes and the form labels are the field (column) names on the table.

Now, what I'm trying to do is create a search feature whereby if a keyword search is conducted, a search through the column names from the table with checkboxes takes place and only lines (rows) with true (checked) checkboxes are returned.

View 12 Replies View Related

Queries :: Retrieve Criteria From Form / When Form Is Closed

Mar 28, 2013

I have a query that retrieves one of its criteria from a form. I have referenced correctly the value on the form from the query, and it works, but what I wanted to do is a bit more complicated: when the form is closed, I want to launch the query with a "default value". I tried to do it in 2 different ways:

a) Defining an "IIf" at the query criteria: I would need a function that checks if the form from which I retrieve the values is open.
b) Defining public variables with a default value, which would be changed from the form: I don't know where/when to initialize the value of the variable.

Query gets criteria from form when it's open. If form is closed, query uses default value.

View 1 Replies View Related

Form With Many CheckBoxes

Jun 6, 2007

Sorry, but this is killing me. I can't find anything in the archive which directly relates.

And it's complicated. I'll try to simplify.

In a nutshell:

As I scroll each Employee on a Parent form, I'd like a subform with functionality to check off any Certifications earned by this person and write the EmployeeID and CertificationID to a junction table.

Seems to me it should be simple, but...


Anyway, here is the probably overcomplicated version here:

The one side tables are 1. Employees and 2. Certifications
The junction table records which certifications employees possess. This table contains some Boolean fields.

The Parent form knows the EmployeeID.

My goal is to create a subform on which to display the full list of Certifications, something similar to the attached image, with a button to add an EmployeeID to the junction table AND tick off the Boolean checkboxes.

I've based the subform on a query showing ALL Certifications and all (Junction) records where there is a match

Because the junction table only stores related Employees and Certifications as entered, the checkboxes on my subform cannot be bound directly to the fields in the junction table and, at the same time, allow me to check off the Booleans.

Perhaps a little db redesign? Any help greatly appreciated.

View 2 Replies View Related

Query By Form With Checkboxes

Oct 18, 2006

Hi! I am wondering if there is a way to do a query by form, where instead of typing in the values you are searching for, you select checkboxes, based on fields in the query you are searching.

For example, I have employees with a list of current competencies. I want to search for employees with specific competencies by checking checkboxes (or selecting from combo boxes) and have the form/query show me which employees possess these competencies/skills.

Any help would be appreciated. Thank you!

KellyJo

View 1 Replies View Related

Queries :: Passing From Form Criteria Is Not Working

Feb 2, 2014

This is my passing criteria to query field:

IIf([Forms]![FrmUserSelection]![PricingType]=3,1 Or 2,[Forms]![FrmUserSelection]![PricingType])

My field is Pricing Type and holds records 1 or 2..I would like to pass value from my group option from a form.It works fine if group option has a value 1 or 2 but it displays no records if option value is 3 What is wrong with my code.

View 4 Replies View Related

Queries :: Set Query Criteria From A Text Box On A Form

Feb 26, 2014

I'm trying set the query criteria from a textbox on a form. It's a Status field in the query. 1 = Open, 2 = Closed. If I set the criteria to "1" it shows all open, "2" and it shows all closed and "1" or "2" it shows all. The problem I'm having is setting these in the form. I've set the query to pull the value from the form. I can get the Open or Closed to work but not the All. My textbox shows exactly how the criteria should read "1" or "2" but doesn't show any results.

View 3 Replies View Related

Queries :: Using Form Text Box As Query Criteria

Aug 31, 2014

I've got a continuous form based on a query.Each of the fields have a search box below it (in the footer) which should ideally filter the query.I'm starting with the FirstName field.In the form's query, I've set the criteria to the following for the FirstName field:

Code:
Like "*" & [Forms]![frmStudentDetails]![txtSearchFirstName] & "*"
frmStudentDetails is the form name.
txtSearchFirstName is the search box's name (in the footer).
The AfterUpdate event for txtSearchFirstName is:

Code:
Me.Requery

But, it doesn't work; when I switch to form view, it displays an error. The Microsoft Access database engine does not recognize '[Forms]![frmStudent Details]![txtSearchFirstName]' as a valid field name or expression.

View 12 Replies View Related







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