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
perfectly. However, I have code that runs under the ON CLICK event. The
code changes the focus to other controls, which means the conditional
formatting is no longer displayed. This part makes sense to me.
Here's what doesn't make sense. The last line of code re-establishes
the focus to the text field with a SetFocus command (i.e.
txtMyField.SetFocus). The field definitely has the focus, but the
conditional formatting (Field Has Focus) is not working. It doesn't
seem to apply the conditional formatting even though the field once
again has focus.
HELP!
Thanks in advance. 8 8338
On 26 Oct 2006 14:56:13 -0700, "Typehigh" <nm******@usatoday.com>
wrote:
That's probably by design.
Just like when I programmatically change the value of a control, its
Change event does not fire. But when I manually type a new value, it
does.
-Tom.
>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 perfectly. However, I have code that runs under the ON CLICK event. The code changes the focus to other controls, which means the conditional formatting is no longer displayed. This part makes sense to me.
Here's what doesn't make sense. The last line of code re-establishes the focus to the text field with a SetFocus command (i.e. txtMyField.SetFocus). The field definitely has the focus, but the conditional formatting (Field Has Focus) is not working. It doesn't seem to apply the conditional formatting even though the field once again has focus.
HELP!
Thanks in advance.
Tom,
Okay, I accept your assessment of why programmatic changes don't
trigger conditions or events, but can anyone think of a way to "trick"
the application with vba so that conditional formatting will once again
apply itself to the field.
This is an essential element to my application.
Thanks to all of you for taking the time to help each other out.
Neil
Tom van Stiphout wrote:
On 26 Oct 2006 14:56:13 -0700, "Typehigh" <nm******@usatoday.com>
wrote:
That's probably by design.
Just like when I programmatically change the value of a control, its
Change event does not fire. But when I manually type a new value, it
does.
-Tom.
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
perfectly. However, I have code that runs under the ON CLICK event. The
code changes the focus to other controls, which means the conditional
formatting is no longer displayed. This part makes sense to me.
Here's what doesn't make sense. The last line of code re-establishes
the focus to the text field with a SetFocus command (i.e.
txtMyField.SetFocus). The field definitely has the focus, but the
conditional formatting (Field Has Focus) is not working. It doesn't
seem to apply the conditional formatting even though the field once
again has focus.
HELP!
Thanks in advance.
"Typehigh" <nm******@usatoday.comwrote in news:1161899772.985857.299050
@f16g2000cwb.googlegroups.com:
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
perfectly. However, I have code that runs under the ON CLICK event. The
code changes the focus to other controls, which means the conditional
formatting is no longer displayed. This part makes sense to me.
Here's what doesn't make sense. The last line of code re-establishes
the focus to the text field with a SetFocus command (i.e.
txtMyField.SetFocus). The field definitely has the focus, but the
conditional formatting (Field Has Focus) is not working. It doesn't
seem to apply the conditional formatting even though the field once
again has focus.
What you are describing works for me in Access 2003, that is the
conditional formatting is applied to Text0 (sets backcolor to red) and
Text2 (sets backcolor to blue) when Command4 and Command5 respectively
are clicked.
Private Sub Command4_Click()
Text0.SetFocus
End Sub
Private Sub Command5_Click()
Me.Text2.SetFocus
End Sub
Perhaps you are using a previous version?
or
Perhaps there is something else in your code that prevents the
conditional formatting being applied; in that case you might examine and
test your code or if that fails, post the whole thing here;
or
Perhaps I don't understand.
--
Lyle Fairfield
Lyle,
I just tried it using Access 2003 and had the same results: it's not
working for me.
I just created another db (to recreate my problem) and tried to get the
Conditional Formatting to fail and I couldn't make it happen.
I do have continuous subforms, but even when I jumped all around from
form to form and control to control, I couldn't make the Conditional
Formatting fail like on my current application.
I give up.
Neil
Lyle Fairfield wrote:
"Typehigh" <nm******@usatoday.comwrote in news:1161899772.985857.299050
@f16g2000cwb.googlegroups.com:
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
perfectly. However, I have code that runs under the ON CLICK event. The
code changes the focus to other controls, which means the conditional
formatting is no longer displayed. This part makes sense to me.
Here's what doesn't make sense. The last line of code re-establishes
the focus to the text field with a SetFocus command (i.e.
txtMyField.SetFocus). The field definitely has the focus, but the
conditional formatting (Field Has Focus) is not working. It doesn't
seem to apply the conditional formatting even though the field once
again has focus.
What you are describing works for me in Access 2003, that is the
conditional formatting is applied to Text0 (sets backcolor to red) and
Text2 (sets backcolor to blue) when Command4 and Command5 respectively
are clicked.
Private Sub Command4_Click()
Text0.SetFocus
End Sub
Private Sub Command5_Click()
Me.Text2.SetFocus
End Sub
Perhaps you are using a previous version?
or
Perhaps there is something else in your code that prevents the
conditional formatting being applied; in that case you might examine and
test your code or if that fails, post the whole thing here;
or
Perhaps I don't understand.
--
Lyle Fairfield
"Typehigh" <nm******@usatoday.comwrote in
news:11*********************@i3g2000cwc.googlegrou ps.com:
Lyle,
I just tried it using Access 2003 and had the same results: it's not
working for me.
I just created another db (to recreate my problem) and tried to get
the Conditional Formatting to fail and I couldn't make it happen.
I do have continuous subforms, but even when I jumped all around from
form to form and control to control, I couldn't make the Conditional
Formatting fail like on my current application.
I give up.
Giving up is hard to do ... didn't someone write a song about that?
Regardless it doesn't fit with my style ....
Have you done all the obvious things with your current app?
compact and repair
I'm sure you want to do the simple things before you give up ...
and maybe some not so simple
decompile/compile
(rather than giving up)
saveastext the problem form and then loadfromtext
saveastext 6, "", "newdb.mdb" and then importing all forms and reports
and modules and macros into newdb.mdb?
posting all the code behind the problem form?
and after that ... is the app too big or too secret to zip and share?
Did I mention that I HATE "give up"!
--
Lyle Fairfield
"Lyle Fairfield" <ly***********@aim.comschreef in bericht news:Xn*********************************@216.221.8 1.119...
"Typehigh" <nm******@usatoday.comwrote in
news:11*********************@i3g2000cwc.googlegrou ps.com:
>Lyle,
I just tried it using Access 2003 and had the same results: it's not working for me.
I just created another db (to recreate my problem) and tried to get the Conditional Formatting to fail and I couldn't make it happen.
I do have continuous subforms, but even when I jumped all around from form to form and control to control, I couldn't make the Conditional Formatting fail like on my current application.
I give up.
Giving up is hard to do ... didn't someone write a song about that?
Regardless it doesn't fit with my style ....
Like:
"A quitter never wins
A winner never quits.
When the going get's tough
The tough get going."
(Randy Newman - Memo to my Son)
Arno R
By the time I post something, I've pretty much tried everything.
Compact and Repair, new db with imported code, everything (but the
solution).
I finally figured out a workaround. I believe the problem stems from
multiple nested routines and something way down deep is killing the
focus. Here's what I did.
Created a button control on my form called cmdResetFocus.
I turned off it's visibility (cmdResetFocus.Visible = False)
Removed all of the Set Focus commands from my nests.
Before calling the subroutines. I set the focus to the cmdResetFocus.
Run the routines.
After the routines are run, I shift the focus to the actual desired
field.
Works like a charm.
Now if someone could only solve this problem I would be golden. http://groups.google.com/group/comp....0f92512946a461
Lyle Fairfield wrote:
"Typehigh" <nm******@usatoday.comwrote in
news:11*********************@i3g2000cwc.googlegrou ps.com:
Lyle,
I just tried it using Access 2003 and had the same results: it's not
working for me.
I just created another db (to recreate my problem) and tried to get
the Conditional Formatting to fail and I couldn't make it happen.
I do have continuous subforms, but even when I jumped all around from
form to form and control to control, I couldn't make the Conditional
Formatting fail like on my current application.
I give up.
Giving up is hard to do ... didn't someone write a song about that?
Regardless it doesn't fit with my style ....
Have you done all the obvious things with your current app?
compact and repair
I'm sure you want to do the simple things before you give up ...
and maybe some not so simple
decompile/compile
(rather than giving up)
saveastext the problem form and then loadfromtext
saveastext 6, "", "newdb.mdb" and then importing all forms and reports
and modules and macros into newdb.mdb?
posting all the code behind the problem form?
and after that ... is the app too big or too secret to zip and share?
Did I mention that I HATE "give up"!
--
Lyle Fairfield
You need to use Me.Recalc to force conditional formatting.
--
Darryl Kerkeslager This thread has been closed and replies have been disabled. Please start a new discussion. 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: 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...
|
by: John Baker |
last post by:
Hi:
I have a field that i wish to use the conditional format capability on, and for some
reason it wont work.
The field is a a text box:
=-
I would like to make it red when negative, and...
|
by: Chuck Reed |
last post by:
I am working on a sales report where I show weekly sales by category
for each of the 52 weeks in the year. Each record in my table/report
has the 52 weeks of sales in it. I want to highlight to top...
|
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: 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...
|
by: Andy_Khosravi |
last post by:
I use the formatting trick in A97 to simulate conditional formatting
in continuous forms. It has, up to this point, worked fine. Today I
was making some design changes to the parent form (the...
|
by: Earl Anderson |
last post by:
A business colleague and I are collaborating 'long distance' on an applet
for work. He is doing the programming and I am doing the business process
form design. We had discussed my desire to make...
|
by: Greg (codepug |
last post by:
Access 2000
Using a textbox of a single form, I created a calculated field. The
following code is in the Control Source for this field:
=IIf(=24,+(/),/
)
The numbers that are calculated are...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
| |