Reserved Error??

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

When I try to open a form and use

Me!MyFieldName.SetFocus

I get

Error: 2950
Reserved Error

I don't get this error when I open the form from the Navigation pane only
when I open it from another form.

Any help will be appreciated,
James
 
What version of Access is this? 'Reserved Error' typically means an
unexpected situation, but the ones you more commonly strike have negative
values, so perhaps something else is going on.

Is there any code that's designed to Raise a specific error?

Is MyFieldName the name of a *control*, not merely a field in the form's
Recordset?

In what event is this code? Is to too early to set focus?

Make sure Name AutoCorrect is turned off, and try a compact, decompile,
compact sequence. Then set minimal references and compile. Details of this
process in:
Recovery sequence - Standard steps to recover a database
at:
http://allenbrowne.com/recover.html
 
Using AC2007.
In the On Load of the form I have the following:

If Not IsNull(Me.OpenArgs) Then

With Me.RecordsetClone
.FindFirst "ContactID=" & Me.OpenArgs
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

End If
So it opens on the same record as the calling form.

This error don't occur if the calling form is on the first record (row).
MyFieldName is a field in the forms recordset.
Name AutoCorrect is off.
 
How do I get the cursor toi be on that
field when the form opens? I've also tride
DoCmd.GoToControl.

Thanks,
James
 
Perhaps you did not understand the question I asked.

Imagine a form with a RecordSource of:
SELECT ID, Surname, FirstName, City FROM tblClient;

The form has 3 text boxes for Surname, Firstname and City. There is no
control for ID. It is a field in the form's RecordSource, but not a control
on the form. Therefore you cannot SetFocus to ID.

You can set focus only to a control, not to a field. The SetFocus must use
the name of a control. Sometimes the field and control have the same name,
but you must use the name of the control if they are not the same.
 
The field name is Listing. This is also the value in Name
in the Other tab of the field in design view.
 
Back
Top