472,355 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,355 software developers and data experts.

MSGBox win conditional Formatting is True

DJRhino1175
217 128KB
I have conditional formatting in a textbox based on a value of another textbox.

Expand|Select|Wrap|Line Numbers
  1. [Actual]>[Est Target]
When this code is true in turns the font Bold and Red of the txt box [Actual]

What I need help with is how do I trigger a msgbox based of this conditional formatting? Or would it be better to do an after update code that does the conditional formatting and trigger the msgbox?
4 Weeks Ago #1

✓ answered by isladogs

You could indeed use the AfterUpdate event to do both of these. For example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Actual_AfterUpdate()
  2.     With Me.Actual
  3.         If Me.Actual > Me.Est_Target Then
  4.             .ForeColor = vbRed
  5.             .FontWeight = 700 'bold
  6.             MsgBox "Actual>Ext_Target", vbInformation, "Message Title"
  7.         Else
  8.            .ForeColor = vbBlack
  9.            .FontWeight = 400 'normal
  10.         End If
  11.     End With
  12. End Sub
  13.  
Adjust as appropriate

5 12950
isladogs
422 Expert Mod 256MB
Hi
Apologies for the long delay in responding but there was an issue preventing anyone responding until now.
Have you fixed your problem in the meantime, or do you still need help?
1 Week Ago #2
DJRhino1175
217 128KB
Isla,

No I have not been able to fix this issue as of yet. I still need help.
1 Week Ago #3
isladogs
422 Expert Mod 256MB
You could indeed use the AfterUpdate event to do both of these. For example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Actual_AfterUpdate()
  2.     With Me.Actual
  3.         If Me.Actual > Me.Est_Target Then
  4.             .ForeColor = vbRed
  5.             .FontWeight = 700 'bold
  6.             MsgBox "Actual>Ext_Target", vbInformation, "Message Title"
  7.         Else
  8.            .ForeColor = vbBlack
  9.            .FontWeight = 400 'normal
  10.         End If
  11.     End With
  12. End Sub
  13.  
Adjust as appropriate
1 Week Ago #4
DJRhino1175
217 128KB
Isla,

Thanks for the assist. I will give it a shot. It worked like a charm.

Thanks
1 Week Ago #5
isladogs
422 Expert Mod 256MB
Glad I could help. Good luck with your project
1 Week Ago #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
3
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...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
2
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold...
1
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...
2
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working...
8
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...
11
by: tg989 | last post by:
Okay, here goes. Continuous forms... possibly the best feature of access. The only downside is this: the only way to have a conditional evaluation run on each record invididually is by...
3
gnawoncents
by: gnawoncents | last post by:
Greetings, I am having some trouble with setting up conditional formatting from VBA for a datasheet. The pertinent part of my code is listed below. I'm running a loop and each field will get one...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.