A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

form won't change color



 
 
Thread Tools Display Modes
  #1  
Old April 4th, 2005, 12:57 AM
Donna
external usenet poster
 
Posts: n/a
Default form won't change color

I have a text field that opens another form on the DblClick event. In the
event there is more than 1 record in the form, I have the following code:

If Me.RecordsetClone.RecordCount 1 Then
Me.Section(0).BackColor = 9567269
Else
Me.Section(0).BackColor = 14811105
End If

The form will not change color until I click on the 2nd record. I have put
this code in the On OPen, OnLoad, OnCurrent events & can't get it to change
to the different color until using the navigation buttons gets me to the next
record. I also changed the form view to Continuous.

Any ideas what I"m doing wrong?

  #2  
Old April 4th, 2005, 02:31 AM
fredg
external usenet poster
 
Posts: n/a
Default

On Sun, 3 Apr 2005 16:57:02 -0700, Donna wrote:

I have a text field that opens another form on the DblClick event. In the
event there is more than 1 record in the form, I have the following code:

If Me.RecordsetClone.RecordCount 1 Then
Me.Section(0).BackColor = 9567269
Else
Me.Section(0).BackColor = 14811105
End If

The form will not change color until I click on the 2nd record. I have put
this code in the On OPen, OnLoad, OnCurrent events & can't get it to change
to the different color until using the navigation buttons gets me to the next
record. I also changed the form view to Continuous.

Any ideas what I"m doing wrong?


Your code is telling it not to open UNTIL you have that 2nd record.
Try:
If Me.RecordsetClone.RecordCount = 1 Then

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old April 4th, 2005, 03:41 AM
John Webb via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

Additionally, you may have to repaint the form using

me.repaint

Cheers

John webb

--
Message posted via http://www.accessmonster.com
  #4  
Old April 4th, 2005, 04:59 PM
Donna
external usenet poster
 
Posts: n/a
Default

But now the form changes color when I only have one record in it. I need it
to change color only when there is more than one record - to alert the user
to use the navigation buttons to look for more records

"fredg" wrote:

On Sun, 3 Apr 2005 16:57:02 -0700, Donna wrote:

I have a text field that opens another form on the DblClick event. In the
event there is more than 1 record in the form, I have the following code:

If Me.RecordsetClone.RecordCount 1 Then
Me.Section(0).BackColor = 9567269
Else
Me.Section(0).BackColor = 14811105
End If

The form will not change color until I click on the 2nd record. I have put
this code in the On OPen, OnLoad, OnCurrent events & can't get it to change
to the different color until using the navigation buttons gets me to the next
record. I also changed the form view to Continuous.

Any ideas what I"m doing wrong?


Your code is telling it not to open UNTIL you have that 2nd record.
Try:
If Me.RecordsetClone.RecordCount = 1 Then

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to show both "Yes" and "No" answers from a "yes/no" checkbox? Colin Foster New Users 28 March 18th, 2005 02:19 PM
How do I get colour separated printouts red and black? Karen Publisher 2 November 27th, 2004 11:14 PM
open a form through a subform in access 2000 Tammy Setting Up & Running Reports 12 October 22nd, 2004 02:43 PM
Strange stLinkCriteria behaviour on command button Anthony Dowd Using Forms 3 August 21st, 2004 03:01 AM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM


All times are GMT +1. The time now is 07:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.