Missing Controls in Locals Window??? Runtime error 2424

C

Clif McIrvin

Hi all. I may be asking the wrong question, but it's the best
understanding I have at the moment. I've got a form that uses the office
assistant balloon to present context sensitive user instructions. I'm
showing and closing the balloon in the enter and exit events for the
various controls. This seems to be working as expected... *most* of the
time.

I thought I'd tracked the trouble down to attempting to execute on an
empty recordset (code sample below) but this morning Access (2003 SP3 on
XP Pro SP2) threw run-time error 2424 "The expression you entered has a
field, control, or property name that Microsoft Office Access can't
find." on a non-empty recordset.

In the process of trying to discover what is going wrong, I observed
that only some of the form's controls appear in the Locals window under
"Me" (they are all present in the relevant "Items" collection.) It just
so happens that the checkbox I'm testing is one of the "missing"
controls.

The code is compiled, and intellisense shows me the control if I enter
"Me."

As I'm typing this the question came to mind: could this be related to
the control having the same name as the field in the Query behind the
recordset?

It is a bound control.

Here's the code that is throwing the error:

Private Sub Remarks_Exit(Cancel As Integer)
If Me.Recordset.BOF Then 'skip all if empty recordset
ElseIf Me.Box.Value = True Then
myBalloon.Close
End If
End Sub

Here are some values from the Locals Window:

Me - Dynaset - field - False
Me - Controls - Item - Error
Me - Recordset - Bookmark - No Current Record
Me - Recordset - BOF - False
Me - Recordset - EOF - False
Me - Recordset - RecordCount - 1

Looking for suggestions!
 

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