Hey there. I have a form with a subform that has a field that needs to be one color if the field is greater than the quoted number and another color if it is less than the quoted number and just white if it is the same as the quoted number. I have tried the following code directly in the subform but it did not work. Any other suggestions?
Private Sub strRun_Rate_AfterUpdate()
Select Case strRun_Rate.Value
Case Is > strQuotedRate.Value:
Me.strRun_Rate.BackColor = 16744576
Case Is < strQuotedRate.Value:
Me.strRun_Rate.BackColor = 12615935
Case Other:
Me.strRun_Rate.BackColor = 255
End Select
End Sub
Thank you in advance for any help.
13 2727
Use the conditional formatting wizard under the format menu. You can't do it through code.
You also can't do it in Access97, Rabbit! Not with Conditional Formatting!
You also can't do it in Access97, Rabbit! Not with Conditional Formatting!
Ah, ok, I've never used 97 lol.
I started with 2003.
Conditional Formatting came into being with Access 2000!
Sorry, Tarena, just realized that we haven't really addressed your question! I assume, since we're talking about a subform, that it's either a datasheet or continuous form view, and sad to say, there's nothing I know of, using Access 97, that you can do to achieve your goal. The problem is that in these types of forms, anything you do to strRun_Rate in one record will be done to strRun_Rate in all records. Conditional Formatting in Access 2000 and later versions allows you to format a single record in these kinds of forms, but it's not available in ACC97.
Sorry, Tarena, just realized that we haven't really addressed your question! I assume, since we're talking about a subform, that it's either a datasheet or continuous form view, and sad to say, there's nothing I know of, using Access 97, that you can do to achieve your goal. The problem is that in these types of forms, anything you do to strRun_Rate in one record will be done to strRun_Rate in all records. Conditional Formatting in Access 2000 and later versions allows you to format a single record in these kinds of forms, but it's not available in ACC97.
Are you the same missinglinq from Tek Tips?
The one and only! ;0)>
Are you the same missinglinq from Tek Tips?
The one and only! ;0)>
I got the orginal code above from you and modified it a bit...is there code to do this, or is it impossible to do in Access 97 Fforms? I can do this in Reports but I just can't figure out anything in Forms. Am I just out of luck or is there a trick?
I got the orginal code above from you and modified it a bit...is there code to do this, or is it impossible to do in Access 97 Fforms? I can do this in Reports but I just can't figure out anything in Forms. Am I just out of luck or is there a trick?
Here's the full deal...I have a main form named "FactoryProcessCard", in this form I have a subform called "FactoryProcessCard(Run@Rate)" which has one field that is shown which is the "Run@Rate" that is pulled from a table called "PartsPressSettings". The subform is linked to the main for by "part#" and "press#" fields. I do not care if the whole subform changes colors or just the field within the subform changes colors...if that or any of this matters.
The code will work in Access97, but only for Single View forms. Maybe I missed the fact that you were using Access97 in the earlier post, when I gave you the code you used as a basis for this, or possibly you didn't mention it in your original posting. You should always mention that you're using 97, as this earlier version lacks many of the features of later versions, and you should also mention the type of form you're talking about, because, as in this case, it can make a big difference. As I said before, I know of no way you can accomplish your goal, under these circumstances. Sorry!
Linq
The code will work in Access97, but only for Single View forms. Maybe I missed the fact that you were using Access97 in the earlier post, when I gave you the code you used as a basis for this, or possibly you didn't mention it in your original posting. You should always mention that you're using 97, as this earlier version lacks many of the features of later versions, and you should also mention the type of form you're talking about, because, as in this case, it can make a big difference. As I said before, I know of no way you can accomplish your goal, under these circumstances. Sorry!
Linq
Well, thank you for clearing it up for me then and the version was mentioned in both cases. I appreciate everyones help.
Sorry we couldn't be of more help! You really should think about upgrading to a newer verion of Access, if you can afford it. I wouldn't move to Access2007 at this point (it's almost like a defferent program) but moving to 2000 or 2003 what be a major plus for you.
Sorry we couldn't be of more help! You really should think about upgrading to a newer verion of Access, if you can afford it. I wouldn't move to Access2007 at this point (it's almost like a defferent program) but moving to 2000 or 2003 what be a major plus for you.
Oh no...just knowing that it can't be done was just the help I needed. I actually did get it to work by putting a label over my text box and having it show in certain cases. I agree with you on upgrading unfortunately I am not the deciding factor...I just have to make what we've got work. lol!!!!!!!!! learning experience.
Thank you so much
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jouke Langhout |
last post by:
Hello all!
For quite some time now, I've got the following problem:
Access won't close properly when a user closes the application. An
ACCESS process stays active and that process can only be...
|
by: Megan |
last post by:
Can you write conditional VBA code that affects only one or two
records on a continuous subform?
I have a form with a subform on it. The parent/ child field that links
the forms is CaseID. The...
|
by: Dimitri Furman |
last post by:
Given:
Access 2002/2003
A subform in datasheet or continuous view, placed on a tab page (this last
may or may not matter)
Conditional formatting applied to some controls on the subform -
format...
|
by: Von Bailey |
last post by:
I have a form where the conditional formatting is set on some fields
to bold if certain conditions are met. However, when the conditions
are met some of the data that is to bold is either not...
|
by: Andrew Chanter |
last post by:
Does anyone know a way you can use conditional formatting to create a banded
style view as is commonly seen on the internet. (In othe words the first
record appears on a gray background, the 2nd...
|
by: GGerard |
last post by:
Hello
Is there a way to use a variable in the Conditional Formatting of a Textbox?
Example :
I want the background of a textbox in a continuous form to change color when
the value of...
|
by: Typehigh |
last post by:
I have many text fields with conditional formatting applied,
specifically when the condition is "Field Has Focus". Without any
events associated with the fields the conditional formatting works...
|
by: midlothian |
last post by:
Hello,
I have conditional formatting set up on a subform based on a calculated
value in the underlying query. For instance, if Sales are >$1000, the
query displays "Yes," otherwise it displays...
|
by: Filips Benoit |
last post by:
Dear All,
Access 2003 adp on SQL_server 2005
A continious form showing 1 month based on table 'CALENDAR_MONTH_GRID' and
fill with a SP.
Fields: Companyname, Day1, day2, etc.
The value in the...
|
by: robertng90025 |
last post by:
I'm having a problem with MS Access 2003 and its conditional
formatting.
I have textboxes on a continuous form whose left and right margins are
set to 0.03 inches. Based on each textbox's...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |