Error 2465 cant find "

S

SoggyCashew

Hello, I have been using this DB for about 2 years and just all the sudden
when only I open it I get an error

Run Time Error '2465';
Cant find the field " refered to in your expression

Then debug takes me to a module that is used for mouse over effect in my
switchboard to make letters bold.

Now this only happens to me when I open the DB if someone else opens it on
the same PC then it works fine? I cant figure out why its doing this. I have
no missing references. Thanks!
 
S

SoggyCashew

Debug is taking me to the line With frm(ctlPrevious)


Option Compare Database
Option Explicit
Dim ctlPrevious As String

Function SetNormal(frm As Form)
Const conNormal = 400
On Error Resume Next
With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color back to blue
End With
End Function
 
K

Keith Wilby

SoggyCashew said:
Debug is taking me to the line With frm(ctlPrevious)


Option Compare Database
Option Explicit
Dim ctlPrevious As String

Function SetNormal(frm As Form)
Const conNormal = 400
On Error Resume Next
With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color back to blue
End With
End Function

ctlPrevious will be empty at run-time in the above code. Is there more?

Keith.
www.keithwilby.com
 
S

SoggyCashew

This is the entire module that takes care of the mouse over effect im getting
the error on.
Option Compare Database
Option Explicit
Dim ctlPrevious As String

Function SetBold(frm As Form, strControlName As String)
Const conBold = 700
Const conNormal = 400
On Error Resume Next
With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color to blue
End With
ctlPrevious = strControlName
With frm(strControlName)
.FontWeight = conBold
.ForeColor = 32768 'Sets the color to green
End With
End Function

Function SetNormal(frm As Form)
Const conNormal = 400
On Error Resume Next
With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color back to blue
End With
End Function
 
K

Keith Wilby

SoggyCashew said:
This is the entire module that takes care of the mouse over effect im
getting
the error on.
Option Compare Database
Option Explicit
Dim ctlPrevious As String

Function SetBold(frm As Form, strControlName As String)
Const conBold = 700
Const conNormal = 400
On Error Resume Next
With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color to blue
End With
ctlPrevious = strControlName
With frm(strControlName)
.FontWeight = conBold
.ForeColor = 32768 'Sets the color to green
End With
End Function

Function SetNormal(frm As Form)
Const conNormal = 400
On Error Resume Next
With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color back to blue
End With
End Function

I reckon that

With frm(ctlPrevious)
.FontWeight = conNormal
.ForeColor = 8388608 'Sets the color to blue
End With

in "Function SetBold" needs to be deleted because it serves no purpose as
far as I can tell because "ctlPrevious" is empty at that stage. If
"Function SetBold" runs before "Function SetNormal" then "ctlPrevious" will
have a value by the time it's needed in "Function SetNormal".

Keith.
 
S

SoggyCashew

Keith, Im not on the machine thats giving me the error so I will have to try
deleting that tonight! However, I have a copy on this machine and I did
delete the section you said and my mouse over still works on my form as it
did before BUT, I wasnt getting the errors on this PC I was getting them on
the one im going to try tonight at work. I will post back tonight with the
results. Thanks!
 
S

SoggyCashew

Kieth, I tried it on the troubled PC and it still didnt work? Any other
sugestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top