Reports: Conditional Statements In Text Box

Mar 3, 2006

I am creating a report based off a query. My problem is that I am trying to create conditional statements within a unbounded text box. I would like to say: =[Field] where [Field2] = X. Unfortunately, I can not find any support on this matter.

View Replies


ADVERTISEMENT

Conditional Statements

Aug 16, 2006

What is the best way to handle a complex conditonal statement like this? I thought about nested statements but i'm not sure if i can put all of these statements in the expression. There are some other conditions that i did not include.

If VBand = A and if CBand = A, allowed
If VBand = B and if CBand = B, allowed
If VBand = A and if CBand = A/B, allowed
If VBand = B and if CBand = A/B, allowed
If VBand = A and if CBand = A/C, allowed
If VBand = B and if CBand = B/C, allowed
If VBand = A and if CBand = A/C, allowed

If VBand = B and if CBand = C, not allowed
If VBand = B and if CBand = C, not allowed except certain areas
If VBand = A and if CBand = C, not allowed
If VBand = C and if CBand = A, not allowed except certain areas
If VBand = C and if CBand = C, not allowed
If VBand = A and if CBand = B, not allowed except certain areas
If VBand = C and if CBand = B, not allowed except certain areas
If VBand = A and if CBand = B/C, not allowed
If VBand = B and if CBand = A/C, not allowed
If VBand = C and if CBand = A/C, not allowed
If VBand = C and if CBand = A/B, not allowed
If VBand = C and if CBand = A/B/C, not allowed
If VBand = C and if CBand = B/C, not allowed except certain area

View 1 Replies View Related

Reports :: Conditional Formatting Text Box On A Report

Jul 3, 2013

I have a text box on a report from the Control Source CSCS Expiry Date. The format in the table and query and report is Short Date. The Text Format is Plain Text.

I have named the text box txtCSCSExpiryDate. I would like to make the background red when the date is 01/04/2013. I have ensured the text box back style is normal.

I am using expression
[txtCSCSExpiryDate]=#01/04/2013#

And in case it was the Control Source:
[CSCS Expiry Date]=#01/04/2013#

I also tried:
[CSCS Expiry Date]<Date()
[txtCSCSExpiryDate]<Date()

I applied the formatting each time, tried closing and re-opening the database. Changed the background format colour to green instead of red and even restarted my computer and it just stays exactly the same.

I've just noticed something else. I have a screen only button on my report header with

DoCmd.OpenReport "All_CSCSExpiry_Rpt" acViewPreview

Which has also stopped working. I get an error:

The expression On Click you entered as the event property setting produced the following error: A problem occurred while Employee Details was communicating with the OLE server or ActiveX Control.

Is this linked to my formatting not working?

I've just checked and on my 5 reports all of the print buttons are giving me this error! (I added the button as they are part of a navigation form menu which only shows report view, I am editing in the original report design view though.) They were working yesterday! Is it because I compacted and repaired the database?

View 4 Replies View Related

Modules & VBA :: Edit Conditional Statements Via Form

Aug 31, 2013

I have a table of marks of student, a query that calculates totals and a form that displays results. on the query, i have an if statement.

Code:
comment:IIf([Marks]>=80,"good",IIf([Marks]>=50,"fair",IIf([Marks]>=40,"Work harder")))

So i want to be able to make the whole syntax available for user to edit without actually doing it in vba. is this possible in vba? i have attached an image

View 8 Replies View Related

Queries :: IIF Conditional Statements To Assign New Values In Table

Apr 11, 2013

I am writing some iif conditional statements in one of my tables to assign new values in that table.

Code:
FP: IIf([cohort with status].[Intake Date] Between #04/01/2012# And #26/04/2012#,201201) Or IIf([cohort with status].[Intake Date] Between #27/04/2012# And #24/05/2012#,201202)

When I run it, I am getting some -1 values in the new column FP.

but if I get rid of the second IIF, then it works.

how do you combine multiple IIF statements in a query?

View 1 Replies View Related

Reports :: IIF Statements With AND (multiple Criteria)

May 7, 2013

I have a list of projects and I need to display their status (Red or Green) in a text box.

My fields are [PercentComplete],[StartDate],[EndDate],[ReportDate]

There are two ways a project could have a red status.

1. [PercentComplete] < 100 AND [ReportDate] < [EndDate]
OR
2. [PercentComplete]<100 AND IsNull([EndDate])

There is one way it could have a green status:
[PercentComplete] = 100 AND Not IsNull([StartDate])

This is the best I could come up with for the Iif statement, but I get "invalid argument" which I suspect relates to the AND portion.

Code:
Iif([PercentComplete] < 100 AND [ReportDate] < [EndDate], "Red",
[PercentComplete]<100 AND IsNull([EndDate]),"Red",
[PercentComplete] = 100 AND Not IsNull([StartDate]),"Green","")))

View 4 Replies View Related

IF Statements For Text Boxes

May 30, 2012

IF statement to check if all the boxes are filled, if not then throw "Please complete all fields" when I click on "add record button"..here is how my code looks and the picture is attached:

Private Sub btnSaveCommand_Click()
Me.AppointmentDate.SetFocus
If Me.AppointmentDate.Text = "" Then
MsgBox "Please complete all fields"
ElseIf Me.cboClient.Value Then

[code]....

View 6 Replies View Related

Reports :: Nested IIF Statements With 2 Criteria To Meet

Dec 2, 2014

I have a report based on a query and in that report I added a text box to be yes or no depending on 1) the number of days to complete and 2) the type of urgency. There's 3 different urgency levels so I was trying to create iif statements based on each one with the corresponding days using the OR operator between them like below:

=IIf([t_Days]<=2 And [Urgency Level]="Expedite (1-2 days)","Yes","No")_
Or IIf([t_Days]<=7 And [Urgency Level]="Normal (5-7 days)","Yes","No")_
Or IIf([t_Days]<=30 And [Urgency Level]="Low (14-30 days)","Yes","No")

Any 1 of those by themselves works fine but I need it based on all of that. So with that said, is there a way to do this? I tried using VBA code, but I think with the type of report I'm running that that wont work. It has a repetitive one line detail section with the data I'm trying to view.

View 4 Replies View Related

Reports :: Printing Statements For Clients - Different Formats Within Same Report

Aug 5, 2015

I am printing statements for clients. Depending on certain criteria about the client, the format of the statement changes completely. This is just how the boss wants it, I have no control. I still want to generate all statements at one time (not separate reports).

I currently have this working using multiple subreports, and changing their Visibility property, only one being visible at any one time. This works, but it is very slow, I assume because I am basically making Access do triple the work (I have 3 subreports).

I pretty confident this is not the intended use of subreports. Is there a "correct" way to do what I am doing? I know I could just manipulate everything with VBA, but having subreports makes editing the different formats very easy.

View 10 Replies View Related

Reports :: More Than 3 Conditional Format

Dec 2, 2013

I have a report with a list of employee names (and other information). A handful of them need to be a different color (other than default). There will always be more than 3, so I can't use the conditional formatting tool.

View 14 Replies View Related

Conditional Formatting In Reports Using Dates

Sep 1, 2005

In my report I have date fields that span over 5 years with different pull dates ex. 3, 6, 9,12,24,36,48 and 60 months. I have successfully formatted these fields using the conditional format by:
Expression Is Date()<[9 Month] and Date()>[6 Month]
for the 9 month field and so forth for each field. This has allowed me to highlight the field that is the next upcomming date. One report I have this works fine for, very simple report. In a more complicated report, I have moved the fields together and have highlighted every other row to segregate them this formatting does not work. It will highlight the field, but it will pull in earlier dates, from 2004. Is there another way to format the fields with conditions other than the condition format? Possible to do it in code similar to highlighting every other line? The example I followed was here:
http://support.microsoft.com/kb/q210392

I will be out and about for a couple of days, but will return any replys to questions when I get back.

Thanks

View 4 Replies View Related

Reports :: Cannot Get Conditional Formatting To Work

Dec 29, 2013

however conditional formatting is simply not working. I have two fields on a report, the report is based on a query, and the two fields are called "ExpectedCost" and "ActualCost". I want "ActualCost" to turn red if and when it is greater than "ExpectedCost". I clicked on "ActualCost" and then clicked on "Conditional Formatting". I selected "Expression" and then put the following expression in the space available: [ActualCost]>[ExpectedCost]

The syntax seems to be correct; however it just isn't working.

View 5 Replies View Related

Reports :: Conditional Object Visibility?

Jun 5, 2013

I have a table w/field: Number {1,2,3,4,5,6,7,8,9,10} I have a report based on the table containing:

1 field: Number, box A and box B.

I would like for the report to show Box B if Number > 5, else show Box A.

View 4 Replies View Related

Reports :: Conditional Formatting On Row Of Fields

Apr 29, 2014

I have a field on a report that I was able to make bold using conditional formatting. I want to make the other fields in the row bold as well if the value of the 1st field equals a set value.

EX: Contractor Bid Amount Sq Footage =[bid amount]/[sq footage] =[bid amount]/[estimate]

I put conditional formatting on the Contractor field

EX: Field Value Is equal to "Estimations"

I was Bid Amount, Sq Footage, =[bid amount]/[sq footage] and =[bid amount]/[estimate] fields to also be bold if the Contractor field is equal to Estimations.

View 11 Replies View Related

Reports :: Conditional Formatting From Another Cell

Sep 5, 2014

I wish to use the conditional formatting that if the date required has passed the current date - i wish for everything for that record be turned red when searched or printed.

ive managed to make the Date Reqd turn red but i dont know how i will make the other cells follow the conditional formatting from another cell?

My other Cells i wish to change to red from the Date Reqd are - Customer Code, Site, Plot No, Product

View 14 Replies View Related

Access Reports - Conditional Formatting

Aug 7, 2014

I am making a planner in the access 2010 report. I am showing which activity finished when but I also want to highlight/ shade the cell to the corresponding month on the planner to the right. See picture above. I tried conditional formatting with date rage 1/1/2014 and 31/1/2014 but it does not gives me accurate result.

View 3 Replies View Related

Reports :: Conditional Formatting Skips First Record?

Jul 24, 2013

I have a report where I read the value of a field in my query (a boolean) field, and if the value is true, I display two lines on my report, hide the lines if the value is false. Here's the code:

Private Sub Report_Page()
If Me.Flagged.Value = True Then
Me.Line102.Visible = True
Me.Line95.Visible = True
Else
Me.Line102.Visible = False
Me.Line95.Visible = False
End If
End Sub

This code works great.... except on the first page of the report! If I run the report in break mode, I can see that it evaluates my condition as "False" on the first record, regardless of the actual value in the field.

My report is based on a query that has some conditions in it, but, everything works correctly - except page 1.

View 2 Replies View Related

Reports :: Conditional Formatting Display On Load?

Mar 7, 2014

I'm using Access 2010. I set up conditional formatting in some areas of my report. They're very simple like if a cell is between 0 and .4, then the background color of the field is red. They work just fine...when I click on the field. I don't remember ever running into this issue in the past. I've been reading potential solutions on the web, but haven't found a way to make the conditional formatting rules kick in when the report is loaded.

View 5 Replies View Related

Reports :: Conditional Formatting Two Fields In Report

Mar 26, 2015

In my Access 2010 report, I am attempting to perform conditional formatting of one field based on the difference between two fields. In particular, one field is "Time Scheduled" and the other field is "Time In". If the "Time In" is equal to or greater than 60 minutes of "Time Scheduled", I would like to format it to be red font. If it is less, I would like to format it to be green font.how I can conditionally format to do this?

View 12 Replies View Related

Reports :: Add Conditional Formatting To Several Fields In A Report?

Mar 20, 2014

I am trying to add conditional formatting to a several fields in a report. So far i can use the contional formatting to set a field called [colour] to set that field to red and bold. But i believe I need to use an Expression for all fields, so I can make all fields that = red go red. I have used the the expression:

[colour] = "red"

but nothing happens.

Expression Is [Subtotal]+[Freight] > 50

View 4 Replies View Related

Reports :: Conditional Hide Section - No Value In A Control

Aug 7, 2014

I have master and child fields in my query, and in my report I have blank controls where there is no child record to the master. I'm trying to set the section (Group Header and Detail) to be invisible when there's no value in a control.

However, as soon as I introduce an If statement to the VBA in a report, regardless of the event I put it in, it just stops working completely.

View 1 Replies View Related

Reports :: Crosstab Report With Conditional Formatting

Feb 22, 2015

I am playing with a report. Crosstab report works, but I would like to print check mark if value is "X". Other values are "A" and "E" and they need to remain as they are.

View 4 Replies View Related

Conditional Text Box For Two Fields

Aug 12, 2011

I have text boxes that combine two fields into one, for example the control source is =IIf(IsNull([BuckC])=True And IsNull([BoostC])=True,"",[BuckC] & " , " & [BoostC]) . For simple its just =[Buckc] + ": "+[BoostC]. I am trying to set a condition that if one of them exceeds a certain number the background color will change to yellow. I know how to do this if its only for one field but I am wondering if it is possible to do it with multiple fields?

View 9 Replies View Related

Reports :: Conditional Formatting Based On Two Fields - Highlight In Red?

Feb 17, 2015

So i have two fields I need to tie together for conditional formatting

If the "status" field says "RETURN" and its over "30" days then I need to highlight it RED

If the "status" field says "AVAILABLE" and its over "90" days then I need to highlight it RED

Is this possible?

View 5 Replies View Related

Conditional Formatting 2 Text Boxes

Jun 5, 2006

hi
is it possible to conditionally format a text box based on the value of another text box on the same form? If so hows it done?

thanks v much

View 1 Replies View Related

Reports :: Conditional Formatting On Multiple Fields Based On Two Criteria

Sep 24, 2014

I have a report which I would like to apply conditional formatting on multiple fields. I would like the conditional formatting to be based on two types of criteria

First criteria would be contracts that start with the year 2014. I used the following expression which worked - InStr(1,[ContractNr],"2014" AND [DirectorInCharge]= "Joseph Steinbok" or "Adam Godson")

To this expression I would also like to highlight fields which contracts start with 2014 AND have a particular Director assigned to it. For this I used the following expression - And [DirectorInCharge]="Name"

On their own, both expressions are working but I want to combine them. How do I do this? I've tried the following - InStr(1,[ContractNr],"2014" AND [DirectorInCharge]= "Name") but then nothing is highlighted. I also tried InStr(1,[ContractNr],"2014") AND [DirectorInCharge]= "Name" - in this instance EVERY record was highlighted.

View 4 Replies View Related







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