Conditional Formatting (on OpenForm? - Type Mismatch)

Hi,

I have a form with datasheetview.

I want to add conditional formatting to some textboxes. I have to do this via
code, because it can be variable. (The expression compares the vendor-price
with the client-price.)
I add the conditional formatting on OnOpen-event. The problem is that the
fields have a NULL-value at that time, I guess, because it crashes on the
expression. What am I doing wrong? Via the dialogboxes this works, but via
code it crashes.
(Type mismatch error)

---- Code: -----

Me.TCP_VENDOR.FormatConditions.Delete

Set objFrc = Me.TCP_VENDOR.FormatConditions.Add(acExpression, acGreaterThan,
[TCP_VENDOR] > [TCP_CLIENT] / 1.3)
objFrc.BackColor = RGB(255, 0, 0)

0
christopheb
3/16/2010 1:02:07 PM
access.forms 6864 articles. 2 followers. Follow

0 Replies
1065 Views

Similar Articles

[PageSpeed] 52

Reply:

Similar Artilces:

Conditional Formatting and Formulas 05-10-10
Hi. I want to set up some conditional formatting (in Excel 2003). I want to turn certain cells either red (if any text appears) or green (if the cell appears blank). However, the cells have formulas in them to display information if it is available in other cells. I cannot, however, make the conditional formatting work - as I cannot use functions such as is/is not blank - as the cells still contain formulas - so whilst they are not displaying inforamtion there is still information in the cells which the conditional formatting is picking up. Does anyone know if there is a...

Export 2003 .pst to 2002 format
I'm using Outlook 2002 on my desktop at home and have recently bought laptop with Outlook 2003. I exported the .pst from 2002 to use on m laptop, went away for 3 weeks with the laptop and now want to get tha .pst from 2003 ( with updates) back to 2002. Any suggestions as Outlook indicates that the 2003 format is no compatible with 2002. Cheer -- greg ----------------------------------------------------------------------- gregg's Profile: http://www.msusenet.com/member.php?userid=63 View this thread: http://www.msusenet.com/t-186943743 On Wed, 20 Apr 2005 16:03:47 -1000, gregg &...

Excel pivot table, numbers are reverting to dates format
eThe numbers in my pivot tables suddenly started to revert to dates format on refresh, even after I reformat them. Why should text in cells show as formatted as dates. I think I'm on a parrallel universe where everything is reversed! The workbook was working fine until it unexpectedly started behaving wierd. Any suggestions welcome. Thanks ...

locking in formatting in cells
Is it possible to set a format (such as number with no commas) so that users cannot change it by pasting in data? ...

XML Formatting
How is CRM 3.0 expecting the xml files to be formatted? I am trying to import docs from a previous crm and get this error: The source XML file is not in the expected format and/or contains syntactical errors. Verify that the file is well formed XML and is complete, or try specifying a different file. Any examples would be of a great help. how are you importing? ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "LostInCRMLand" <nmaspdev@gmail.com> wrote in message news:1148678849.309658.204590@g10g2000cwb.googlegroups.com....

number format problem when using =A1&A2 formula
Hello I am trying to use the contents of 2 cells to produce I.D. numbers the first cell contains 2 or 3 letters the second cell is a counter which advances each time a macro is run. I have no problem joining the 2 together by using =A1&A2 (or even =A1&""&A2). The problem is I am compiling a database of several hundred of these records and eventually I sort the records and the results are not in the correct order. If these had just been numbers I would use 0001, 00002 etc by formatting but this is not working when the 2 cells are joined. Even though A1 entry is CH and A2 ...

Time format #3
Hello, I have a spreadsheet with 2 Time columns. All of my formuals work except on over night shifts. So when I add them I get 32 hours on a 23:00 - 07:00 shift when I really want 8 hours. Any suggestions? Thanks, Denise Try =MOD(end_time-start_time,1) -- Regards, Peo Sjoblom "Denise" <anonymous@discussions.microsoft.com> wrote in message news:02bc01c39e54$c5795310$a301280a@phx.gbl... > Hello, > > I have a spreadsheet with 2 Time columns. All of my > formuals work except on over night shifts. So when I add > them I get 32 hours on a 23:00 - 0...

Condition Formats for duplicates with additional criteria
On numerous occasions we have used the preset conditional format for highlighting duplicate or unique values. However, we now have come across the need to highlight duplicate or unique values only if those values meet certain other criteria also. Such a task will lwill likely require a formula, but we are not sure how the Excel so effectively compares values in a large range to identify duplicate or unique values . If we knew how Excel was so efficiently performing these comparisons, we might could incorporate the functions for finding duplicate or unique values and then add addition...

formatting output of if statements
Does anyone know of any way to format the output of an if statement? I'm looking to do a very simple if statement and then based on the output I want the text in that cell to come out either green (if true) or red (if false). Thanks! Have a look at condional formatting on the Format menu and have a play. "J.F." wrote: > Does anyone know of any way to format the output of an if statement? I'm looking to do a very simple if statement and then based on the output I want the text in that cell to come out either green (if true) or red (if false). Thanks! Hi You can use...

Selecting Receipt Formats?
I have set up 2 different receipt formats...the 1st is the default, and the 2nd is custom. In SO Manager Register List I have both of the receipt formats selected...1st (default) as printer 1 and 2nd (custom) as printer 2. I have also ticked the box to allow for Share the OPOS printer in SO Manager. I have done this in Receipt Formats under Register Properties. When I print a receipt, and am prompted to select a printer, whichever I choose 1 or 2 the only format that shows is the 2nd (custom) receipt. If I turn off receipt printer 2 then it goes back to the 1st (default) receipt fo...

Exchange OWA Conditions Page
Hi, I'm a little knew to exchange. About a year ago someone that is no longer here created OWA for all of employees to use. When we open up OWA is works, but we would like a "Terms and Conditions" type page with interaction from the user of "ok" or "cancel" before the users sign in. Is something like this possible? We are currently running Exchange 2003 Standard Server. Thanks in advance! John wrote: > Hi, I'm a little knew to exchange. About a year ago someone that is no > longer here created OWA for all of employees to use. When we ope...

Expression typed incorrect or too complicated
I have a database that I am updating w/ new Models. Got all the Models added and then tried to run the report on these Models. Report uses Query2A which uses Query1 linked to MESPROD_LINESE table. It asks for start date and end date for the report. Since I added the new models, when I run the report, I get {Expression typed incorrect or too complicated] error message. Query1 runs by itself fine though. Here is the SQL for Query2A of the Report. (it all worked fine before) SELECT MESPROD_LINESE.[Line Number], MESPROD_LINESE.[Release Number], MESPROD_LINESE.[Model Number],...

cannot apply the default chart type to the selected data
I can no longer create any pivots charts. The error message I get is "Cannot apply the default chart type to the selected data". How do I resolve this? My data sources have not changed. Thanks, Pick a different chart type, aka change your default (at least temproarily). For instance, you can't have an XY scatter chart be your default chart when making PivotCharts. -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "sam" wrote: > I can no longer create any pivots charts. The error message I get is "Cannot > app...

excel conditional formatting with values rather than colours
I need to do similar to conditional formating, except displaying a valu rather than colouring the cell? if the value of a1 is less than 0.99 inclusive, then display 0.15 i b1 if the value of a1 is 1 or greater and less than 5, then display 0.2 in b1 if the value of a1 is 5 or greater and less than 15, then display 0.3 in b1 If the value of a1 is 15 or greater and less than 30, then display 0.7 in b1 Any help would be much appreciated many Thank -- Message posted from http://www.ExcelForum.com Hi this is only possible with VBA using an event procedure to change your values after the entry...

Format Question
Hello! I am trying to set cell A5 = A1 + A2. The problem that I encounter is Cell A1 is all text and Cell A2 is a Julian Date that I converted to form of 5/1/2005. When I try to set Cell A5 = A1+A2 I lose the Date Formatting and Cell A5 brings over the text and the julian date. Any way to do this? -- donl ------------------------------------------------------------------------ donl's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=21006 View this thread: http://www.excelforum.com/showthread.php?threadid=379620 in cell a5 type in =a1&MONTH(a2)&...

DOTX type files
I am having problems converting dotx type files made with Office 07 with my Officer XP , I downloaded the Compatability Pack and I am still having problems any ideas? Word versions prior to Word 2007 are incompatible with Word 2007 templates. The compatibility pack allows the editing of Word 2007 *documents* only. If you want to edit or create a Word 2007 template you will need Word 2007. If you want to create a template compatible with both versions crete a word97-2003 DOT template. -- <>>< ><<> ><<> <>>< ><<> <&g...

Text and Numeric Conditions
If I have the following in an excel sheet: 7GH467 8SE65D 59FRS5 6ZSHES I need a formula that would meet the following conditions: if the first character is equal to 7 or 8 and the second is a letter to give me 1. if the first character is any number other than 7 or 8 and the second is any letter to give me 2 if the first and second characters are any 2 numbers to give me 3. Thanks for any help. This evaluates an entry in cell A1: =IF(ISNUMBER(VALUE(LEFT(A1,2))),3,IF(OR(LEFT(A1,1)="7",LEFT(A1,1)="8"),1,2)) Copy down as far as you need. Thank you so much, works per...

Excel not recognizing date formats
I'm having a problem with a particular spreadsheet. Some of the cells have dates, typed in MM/DD/YY format, but Excel isn't recognizing it as a date. It won't change the date format (to MM/DD/YYYY) or sort these dates along with other "normal" date cells. I can't seem to figure out what's the problem with these particular cells. When I type a random number like 123 into the cell, it converts it to a date format, but I want it to recognize 1/23/06 as a date and it doesn't. Anyone have any idea of what's going on? It works fine for SOME cells in the ...

Formatted Numbers
Hi All I have number data in two columns as follows Cell A1 1234 Cell B1 056789 Require 1234056789 I tried using =A1&B1 to join them but the 0 disappeared as custom formatting had been applied. Is there a way round this so as to retain the leading zero? Karen One way: =TEXT(A1,"0000") & TEXT(B1,"000000") In article <7fb3611c.0407080554.25a6303f@posting.google.com>, Karen_Thompson90@hotmail.com (Karen) wrote: > Hi All > I have number data in two columns as follows > Cell A1 1234 > Cell B1 056789 > Require 1234056789 > > I tried ...

New Field Type
It would be nice to be able to embed a button in the form that is not part of the database but only has an event assoicated with it. Using the ISV.Config does not have the button where you would want it. This button needs to be like a field so that you can progamitically set the visibility and readonly attributes. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggest...

Custom format with text
I want the number 20 to display as 20 WEEKS I have tried (re Help) 0;;;" WEEKS"@ and various combinations of ; spaces, the lot. Nothing works. Where is the error? Thanks, Hi Pierre, Select the column in which your numbers will be entered. Right-click the mouse on the selection, select Format Cells, then the number tab and select Custom from the list. In the Type box, enter: #,##0 "WEEKS". This will now display 20 WEEKS if the number 20 is entered into any of the cells in the range selected (and any other number of course). Ewan "PierreL" wrote: > I...

Conditional Formating #13
What I have is a simple spread sheet with the months accross the first row and and the sum and average of product sold at the end of each row. What I would like to do is look at each cell and compare it to the average and the end of the cell. If it is lower change the color of that cell. I have attempted the conditional formating but cannot get it to work. Any help would be appreciated. Dec-04 Jan-05 Feb-05 Mar-05 Sum Average 286 535 658 898 2,378 594 1,063 1,495 1,543 1,506 5,607 1402 919 870 834 820 3,444 861 1,055 1,219 1,150 1,173 4,597 1149 1,055 1,511 ...

hooks in reporting tree and row format
Hello: I know that the Golden Rule of reporting trees is that the number of hooks in the tree must equal the number of hooks in the row format. Let's say that you have four hooks in the tree, then, representing the main account segement. Now, let's say that the row format shows (in the Link to GL column) the main account segment and two other segments (department and location). Would the row format, based on that, have more hooks than the reporting tree? My guess is "yes", since the row format is showing not just the main segment but the characters of other two seg...

Format Returned Values in VBA Q
The code below returns for me the values in Cells E6 & B62, but the value in B62 is 18.87% but what is returned for me on my code is 0.1847547857. How can I format what is returned as **.**%? ThisWorkbook.Sheets("Master").Range("E6") & " " & ThisWorkbook.Sheets ("Report").Range("B62") & vbNewLine & _ When you use Range(xx) without specifying a property, the Value property is assumed. Try using the Text property instead... ThisWorkbook.Sheets("Master").Range("E6").Text & " " ...

Print Format
Is there a way to change the Outlook XP username? Any email I print in outlook lists my default email address (which I'm told is also the username) at the top of the email, underlined and boldprint. Then, the message header follows (with the usual from, sent, to, etc). It prints this default email address on every email; even those not received from that account. Can anyone help??? Thanks! You'd have to change the name on the default e-mail account, as far as I know. -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my e-mail address will probably not be answered -- ple...