473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

MSGBox win conditional Formatting is True

DJRhino1175
221 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?
May 2 '23 #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 15470
isladogs
456 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?
May 25 '23 #2
DJRhino1175
221 128KB
Isla,

No I have not been able to fix this issue as of yet. I still need help.
May 26 '23 #3
isladogs
456 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
May 26 '23 #4
DJRhino1175
221 128KB
Isla,

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

Thanks
May 26 '23 #5
isladogs
456 Expert Mod 256MB
Glad I could help. Good luck with your project
May 27 '23 #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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.