Forecolor problem- help?

WinDancer

Registered User.
Local time
Today, 03:36
Joined
Oct 29, 2004
Messages
290
I have the following code to change font colors:

Dim lngBlue As Long
lngRed = RGB(255, 0, 0)
lngBlue = RGB(0, 0, 255)

If [activate1desc] <> "" Then
[41a].Value = [activate1desc]
[41b].Value = [Activate1:]
[41a].ForeColor = lngBlue
[41b].ForeColor = lngBlue

End If

It changes the font on [41a] but errs out on [42b]

Error 438 object doesn't support this property or method

Both fields are text 100....

Thanks!
 
Dim lngBlue As Long
lngRed = RGB(255, 0, 0)
lngBlue = RGB(0, 0, 255)

If [activate1desc] <> "" Then
[41a].Value = [activate1desc]
[41b].Value = [Activate1:]
[41a].ForeColor = lngBlue
[41b].ForeColor = lngBlue

End If

It changes the font on [41a] but errs out on [42b]

Error 438 object doesn't support this property or method

Both fields are text 100....

Thanks!
both fields are text 100? What do you mean by that? check the other properties of that control.

And by the way, beware of using control names in modules that are not preceeded by the "me." notational prefix.

That will cause you a bunch of havoc, and it might be doing it here (although I doubt it). Write the code with that prefix before both of the field names first, and see if that fixes the problem.
 
The text 100 means that the field is text type and allows up to 100 alpha chars.

I changed the names to include the 'me' and it did the same error in the same spot.

It follows the instruction about changing the color on the first field, then errs out on the second field with the same code.

Thanks
 
Change the RGB function of second text box to lngRED instead of lngBLUE. See what happens then.

(This is a "sneeking suspicion" test)
 
No change with the color switch... I will do a work-around, need to get this finished up.
Thanks for the suggestions,
Dave
 
UpDate:
The routines were running so fast the the color change was requested before the field was through filling, so there was no object there to change color on.
I added a 1 secong pause between the fill and color code and it runs fine.
Thanks again for all the suggestions :)
 

Users who are viewing this thread

Back
Top Bottom