Error Message

ddrew

seasoned user
Local time
Today, 02:42
Joined
Jan 26, 2003
Messages
911
I get the following error message when I open a form, but I cant see anything wrong:

Run Time Error '2447':

There is an invalid use of the . (dot) or ! operator or invalid parenttheses.

This is the code that causes the problem:

Private Sub Form_Activate()
If Me.SumOfTotalGVS > 16 Then
MsgBox "You have exceded the total amount of GVS on the CATT site"
Let Me.SumOfTotalGVS.BackColor = 255
Me.SumOfTotalGVS.ForeColor = 65535
Else
Let Me.SumOfTotalGVS.BackColor = 16777215
Me.SumOfTotalGVS.ForeColor = 0
End If
End Sub
 
Not sure if I ever used a 'Let' statement like that...(??)
 
OK I removed let, but i still get the same error

If Me.SumOfTotalGVS > 16 Then

MsgBox "You have exceded the total amount of GVS on the CATT site!,"
Me.SumOfTotalGVS.BackColor = 255
Me.SumOfTotalGVS.ForeColor = 65535

Else
Me.SumOfTotalGVS.BackColor = 16777215
Me.SumOfTotalGVS.ForeColor = 0
End If
 
Hum... I can't see anything else...

What line does it zonk on when you step through it?
 
And 'SumOfTotalGVS' is the name of a text box on the form?
 
Maybe:

If Val(Me!SumOfTotalGVS) > 16 Then


???
 
ddrew said:
Me.SumOfTotalGVS.BackColor = 255
Me.SumOfTotalGVS.ForeColor = 65535

Else
Me.SumOfTotalGVS.BackColor = 16777215
Me.SumOfTotalGVS.ForeColor = 0

In stead of me.Sum........ try :

Me!SumOfTotalGVS.BackColor = RGB(255,255, 255)

etc.
 
I dont beleive that this is the problem. The code works fine. The only time this error appears is when I open the DB.
 
I think something else is causing it. Have you compiled the entire form code to see if it zonks in any other places? Can you cut out enough to post?
 
Ive compiled the DB and it shows no errors. Not evan in that piece of code. The smallest I can get it is about 2mb. Im happy to PM it to you if you really want to look. Aside from that its going to take a lot of stripping out.
 
Can you do a new db, then import the form and table (with just a couple records then post that?
 
What ever happen to this? Any success in eliminating the error?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom