Problem with iif and datediff expression in form

Hi,
I have a form where I have to display the value of the field based on some 
criteria. 
The first criteria is 

=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
and the second criteria to add is 

dbo_PWO_Status.[Quote] =  -1

My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
criteria in the iif statement? 

The second question I have is that with the first  expression put in the 
source for display I am getting Name instead of the Y value for matching 
condition. I would appreciate any help. Thanks.
0
Utf
11/2/2007 3:51:02 PM
access.forms 6864 articles. 2 followers. Follow

3 Replies
1872 Views

Similar Articles

[PageSpeed] 58

You need a nested IIf statement:

=iif([dbo_PWO_Status].[Quote] = -1, IIf((DateDiff("d",[dbo_PWO_Status].
[WorkOrderDate],Now())-180)>0,"Y",""), "") 





Jack wrote:
>Hi,
>I have a form where I have to display the value of the field based on some 
>criteria. 
>The first criteria is 
>
>=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
>and the second criteria to add is 
>
>dbo_PWO_Status.[Quote] =  -1
>
>My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
>criteria in the iif statement? 
>
>The second question I have is that with the first  expression put in the 
>source for display I am getting Name instead of the Y value for matching 
>condition. I would appreciate any help. Thanks.

-- 
Message posted via http://www.accessmonster.com

0
benyod79
11/2/2007 4:01:22 PM
Make sure you're referencing the correct field names.


Jack wrote:
>Hi,
>I have a form where I have to display the value of the field based on some 
>criteria. 
>The first criteria is 
>
>=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
>and the second criteria to add is 
>
>dbo_PWO_Status.[Quote] =  -1
>
>My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
>criteria in the iif statement? 
>
>The second question I have is that with the first  expression put in the 
>source for display I am getting Name instead of the Y value for matching 
>condition. I would appreciate any help. Thanks.

-- 
Message posted via http://www.accessmonster.com

0
benyod79
11/2/2007 4:03:03 PM
Thanks for your help. I appreciate it. Regards

"benyod79 via AccessMonster.com" wrote:

> Make sure you're referencing the correct field names.
> 
> 
> Jack wrote:
> >Hi,
> >I have a form where I have to display the value of the field based on some 
> >criteria. 
> >The first criteria is 
> >
> >=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","") 
> >and the second criteria to add is 
> >
> >dbo_PWO_Status.[Quote] =  -1
> >
> >My first question is how do I accommodate the dbo_PWO_Status.[Quote] =  -1 
> >criteria in the iif statement? 
> >
> >The second question I have is that with the first  expression put in the 
> >source for display I am getting Name instead of the Y value for matching 
> >condition. I would appreciate any help. Thanks.
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> 
0
Utf
11/2/2007 7:40:02 PM
Reply:

Similar Artilces:

Replace/modify standard data form?
Hi, I want to replace the standard data form, which is used to maintain data sets in an excel table, by a user defined form (alternatively I would like to modify the standard form). Does anybody know if/how this is possible? Thanks, Axel Axel, Going to need more information I'm afraid. Can you explain further or send an example? -- Jon Quixley ------------------------------------------------------------------------ Jon Quixley's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25803 View this thread: http://www.excelforum.com/showthread.php?threadid=3985...

Problem inserting a node with a namespace
This is so silly I must be doing something wrong! I need to insert (using VB.NET) a new node in a DOM; node has a namespace. I first create, under programme, basic structure, starting thus: <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/" xmlns:pcv="http://prismstandard.org/namespaces/1.2/pcv/"> Then I attempt to add a node with rdf namespace prefix. My call in skeleton is: CreateElement("rdf", "subje...

Outlook 2002 not working/Outlook Express is working_Help!
My Outlook stopped working last Friday, I'm not receiving any new emails, I cannot move any files that are in my inbox to any subfolders, and I'm not sure if the emails that I send are even getting to where they are supposed to go! I work for an advertising business and these emails are very important! I also have Outlook Express on the computer and I just checked it and it is receiving all of my emails. Outlook is set as the default and I've tried restarting the computer as well as removing Outlook and re-installing it and nothing works. Any feedback is appreciated! You...

problem carrying over values
I have one form that has a button I''ll call it form1. The button looks at a text box for an ID and if its null it opens form2 and creates a new record in form2. If the text box is NOT null, it will go find the ID that's in the text box and filter it in form2. When the new record is created in form2, I need the ID to be put into the NULL text box in form1. I know how to do this however, if you open form2 on its own, then the error msg comes up that it can't find form1. I know why I'm getting this error, but don't know the fix for it. Is there a work around? Thanks...

Realteck 5.1 (6 channel) sound problem
Hi, I have finally got round to connecting all my speakers up to my fairly new PC. I have a Soundblaster desktop 5.1 speaker system and my new mobo, aa ASrock N68PV-GS, has 3 rear connectors for the onboard Realtek ALC662 system. I connect up my 3 cables, Front Green to Green on the mobo, middle black/blue and the centre/bass pink/orange to the mic in. The Realteck control panel objects to this mic connection. No matter what I try I get everything via the two front speakers. All is set up to 5.1 in the control panel, I have checked all my cables are well seated and in good ...

Copy Data from SubForm Field to Main Form Field
How do you tell Access to copy data from a field in a subform to a similar field in the main form? See www.allenbrowne.com "ridgerunner" wrote: > How do you tell Access to copy data from a field in a subform to a similar > field in the main form? Are you referring to the section entitled "Referring to Controls on a Subform"? Will this actually place of copy of the subform field information into the main form report and, therefore, into the underlying main table? "Golfinray" wrote: > See www.allenbrowne.com > > "ridgerunner" wr...

same subform used in two different forms
Hi Folks, Is it possible to use the same subform in two different main forms simultaneously? If it's possible, is it good practice? I can foresee that there may be problems with code, but the subform I'm thinking of is very basic. Three tables: tblFamily FamID (primary key) FamLastName tblIndividual IndID (primary key) InFamID FirstName MiddleName ....other personal data tblAddress AddressID AdFamID street city state zip Two main forms for different types of data entry frmFamily with family information on the main form and address information...

License Problem
I have networked two macs and purchased and installed two copies of Office:Mac (2004). I now find that my second mac is reading the license info off the first one and not allowing me access on the second one. I have uninstalled and reinstalled the software on the second mac at least a dozen times, then discovered Microsoft's instructions "Error message when you try to start an Office 2004 for Mac program: "Microsoft Office 2004 is already in use". So I followed those instructions at least a dozen times to remove the Office 2004 for Mac licensing information and it has not...

Problems adjusting to XP
I'm a moderately experienced user with two complaints: 1) I accidentally set the 'recently used file list' to zero, and I meant one. In the Options or wherever it is, now, the box is grayed out and I can't get it re-set to 1. Halp!! 2) 97% of my work is with mini-databases which I prefer to have in Excel, and the new Excel keeps reminding me and scolding me for having text labels which appear to be numbers [duh!!] And it scolds me when I sort. How can I tell Excel to stop treating me like an idjit? -- Regards, P D Sterling www.pdsterling.us 1) No Idea 2) Tools>...

cut/copy and paste forumla problem help
i am currently using the correlation formula to test on a large set of data: e.g. CORREL(IGR!C233:C262,IIA!C233:C262) IGR and IIA - they are a pair of data i place in 2 different worksheets, each has set of data, and I need to pull the data of C233 and C262 in IGR and IIA worksheet and I have many pairs in different worksheets E.G. RMR and RHR so I copy the forumla above and hope can only manually adjust the symbol from IGR and IIA to RMR and RHR when I copy it shift the number down =CORREL(IGR!C242:[/B]C271,IIA!C242:C271) from C233 to C242 and C 262 to C271 and I would have to ma...

Problem with code that inspects thread context and dumps stack trace
Hi! Some years ago, I had to debug a Java application that had a deadlock problem. It wasn't so hard, because I've been told about a JVM command (now, I don't even remember how to activate it!) that dumps the status of all threads in an app, including "what they are waiting for" (locks). Now I'm in the "real" world of C++, Win32 applications and MFC (no virtual machines around!). We have many multithreaded applications: what if some bug causes a dedlock, e.g. in a test scenario? We must inspect it, and I'd like to have a tool to simplify my life. Does s...

Cannot start Outlook Express
When I attempt to start Outlook Express I get the following error message. Can anyone help me out ??? MSIMN caused an invalid page fault in module MSOE.DLL at 015f:5f19d33a. Registers: EAX=00000000 CS=015f EIP=5f19d33a EFLGS=00010246 EBX=00000000 SS=0167 ESP=0056f6e4 EBP=0056fa30 ECX=00000000 DS=0167 ESI=00000104 FS=596f EDX=0056f7f8 ES=0167 EDI=0056f9f8 GS=0000 Bytes at CS:EIP: 8b 08 52 50 ff 91 b8 00 00 00 3b c3 0f 8c b8 00 Stack dump: 00000104 00000000 bff850e2 00000000 00000000 0056f81c 5f19d299 00000000 0056f714 00000108 5ec29350 bff850e2 8130d020 01bf2022 00000001 00000000 John...

Problems with customizing styles in the Tracking Gantt
Hi, I want to modify the appearance of critical tasks in the Tracking Gantt but somehow it doesn't work. When I open the Bar Styles dialog, I select the first row (Show for "Normal, Critical" tasks, From - Start, To - Finish). I want to change the default pattern to be tick since when I print the chart the critical tasks almost do not appear. However, when I choose another pattern nothing changes. There is another funny thing. When I double-click a particular task, I see under the Bar Text tab that it shows Baseline Duration to the left and % Complete to the right....

Forum Navigation Funtionality Problems
I am having great difficulty navigating the Excel forum. For example when I clicked on the forum link to "Excel general questions" IE returns the error that the page cannot be found. I have found that if I first click on an Outlook forum and gain access to it, and then click on "Excel general questions" I will gain access immediately. After posting a question to the "Excel general questions" forum, and receiving an email response, the link in the email to the thread took me to an error message that the page was not found. I then navigated manually to the f...

Please Help strange problem
Hope someone can help with this after downloading a small excel file from a dealer site that is a genereated report, I can download it as an excel file, upon doing so and pasting it into my working sheet I end up with this � with the two dots above it at the end of the text in every cell, and when it is removed some cells change for example a cell which has a long number for a serial number will shorten as well where do I start the excel version is 2000 blacklabhfxnospam@hotmail.com remove no spam ...

CRM setup problem
Installed CRM product on Win 2000 SP3, SQL 2000 SP2 box. Install seems to have gone well. Later following reboot, when I brought up the CRM client in web browser mode, none of the drop down lists work on any of the pages like System Options or User Options. I get web page errors saying CLASS NOT REGISTERED. How can I correct this? I am able to do other things in the web client like add users, business units etc, just nothing that requires using a drop down list. ...

Public folders changes problem
Hi On Exchange 2007 I created public folder named "IT" and inside a calendar called "IT calnedar" that is used for all events in our IT department. It's strange when our secretary adds events into this calendar and mark them with different colors (categories) these changes (the right color for each event) are only shown in Outlook 2003 or OWA, but in Outlook 2007 all colors are mixed up. We all have Outlook 2007 in IT department, so we all see wrong colors, but when I try to log-on through OWA or with a test machine that has Outlook 2003 installed everything is O...

OWA Calendar problem
Our orginization is using Exchange Server 2003 1 -backend 2 -Front end servers. We are experiencing an sproradic issues with calendar updates. The owner of a meeting will issue an update to a meeting it will update the calendar in the Outlook Client but will not update in OWA. Any help or ideas would be greatly appreciated "=?Utf-8?B?QmVuIFNoaXZlbHk=?=" <BenShively@discussions.microsoft.com> wrote in news:CBC4CF1E-DC5C-4DC7-A388-7ED964DDD270@microsoft.com: > Our orginization is using Exchange Server 2003 1 -backend 2 -Front end > servers. We are experiencing an spr...

html signature in outlook express 6
Any ideas how to insert a html signature in outlook express 6? Iv'e tried but the thing doesnt show up at the end of sent emails. howard <anonymous@discussions.microsoft.com> wrote: > Any ideas how to insert a html signature in outlook > express 6? Iv'e tried but the thing doesnt show up at the > end of sent emails. Ask in an Outlook Express newsgroup. -- Brian Tillman ...

Simple Rounding Problem
How can I make the number 27.9864 look like 27.9900? I've tried a few things and am doiwn to VB stuff which I don't quite understand so any help would be appreciated. Lisa, If you want to change how a cell is displayed, with the number is in cell A1, the formula =ROUND(A1,2) in another cell, formatted for "0.0000", will show as you desire. If you want to change the number, the macro lines ActiveCell.Value = Application.Round(ActiveCell.Value, 2) ActiveCell.NumberFormat = "0.0000" will change the activecell's actual value. HTH, Bernie MS Excel MVP &quo...

Already solved my MS Money problem
I've been using MS Money for years, so I was disappointed when I found out that MS was discontinuing the software. The way I solved the problem is I downloaded and installed personal finance software onto my linux based machine, so now, not only am I running a totally free operating system, I'm running totally free software. It may not have all the bells, whitsles, and eye candy that MS Money has, but it's just as, if not more reliable. And there's no one who can arbitrarily decide to discontinue it. "Jim" <Jim@discussions.micr...

Excel Conditional Formula Problem #2
undefined::undefined::undefined My e-mail address is retrofit03@yahoo.com. Thanks for your help -- wilson3141 ----------------------------------------------------------------------- wilson31416's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1628 View this thread: http://www.excelforum.com/showthread.php?threadid=27686 ...

Data Migration Framework Installation Problems 02-08-05
Hello When attempting to install the Data Migration Framework to our dev server I am able to run through the enitre wizard using the defaults. The program thenstarts the Loading Data Migration Framework page which runs for aprox thirty seconds then takes me to the final screen with the following: "The wizard was interupted before the Microsoft CRM Data Migration Framework could be completely installed. your system has not been modified. To complete installation at another time, please run setup again." if I do run setup again I get the same scenario. I am running the set up...

post SP3 problem
Since I installed sp3 for office XP and I am running into error. Mostly that outlook "think there another program is trying to access e-mail addresses I have stored in outlook. Do you want to allow this" when I try to open an e-mail or respond to an e-mail. Any idea. Thanks, See http://www.slipstick.com/outlook/ol2002sp3.htm#problems, particularly the instructions for removing the PDFMaker COM add-in frm Outlook. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode...

Simple problem of combo box
Hi, I have access 2000 as front end for SQL server 2000. On the form I have a combo box which lists values from a table. The problem is I want to restrict user from entering only the values in the drop down box. Any help will be greatly appreciated. Thanks ...