form won't change color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
Additionally, you may have to repaint the form using

me.repaint

Cheers

John webb
 
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
 
Back
Top