Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2008, 04:57 AM
Authorized User
 
Join Date: May 2007
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default conditional formatting

Hi all,

Got a novel or quick one for you. I have two text boxes on a form which have conditional formatting applied. The textboxes are unbound linked to separate DCount queries. The form as its a menu regularly being used rather than reload it, when not being used is hidden.

However when its made visible again the conditional formatting is not always being applied. I am using Access 2000 with this system. My code for the activation is:

Private Sub Form_Activate()

    'check the reminders
    Me.txtoutstanding.Requery
    Me.txtfuture.Requery

End Sub


The source for the two fields are:

=DCount("inspectid","qryoutstanding3")

=DCount("inspectid","qryfuture")

My question is there a way to get trigger the conditional formatting from within VBA without building the whole sql query for them both in the VBA to give the system a kick when it doesn't like doing it automatically.

However if you think it will make the system run quicker and easier then by all means tell me so.

 
Old July 3rd, 2008, 10:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

How about adding a Me.Refresh at the end there so that the form itself refreshes (as opposed to JUST the two textboxes)?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old July 3rd, 2008, 11:05 AM
Authorized User
 
Join Date: May 2007
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

tried that one and it works fine for the future, just not the overdue box

 
Old July 3rd, 2008, 11:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

So your code looks like this?

Private Sub Form_Activate()

    'check the reminders
    Me.txtoutstanding.Requery
    Me.txtfuture.Requery
    Me.Refresh

End Sub


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old July 3rd, 2008, 11:20 AM
Authorized User
 
Join Date: May 2007
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

used to when the me.refresh line didn't work i deleted it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting in Continuous Forms Balasarius Access 3 September 19th, 2008 07:06 AM
Conditional formatting vemaju Excel VBA 2 June 6th, 2007 04:41 AM
Conditional Formatting on Subform echovue Access 4 March 3rd, 2006 03:25 AM
Conditional Formatting Corey Access 1 November 8th, 2005 12:18 AM
Conditional Formatting... In Access??? lguzman Access VBA 2 September 23rd, 2004 03:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.