3011 when setting focus to subform in XP

  • Thread starter Thread starter Brian Morris
  • Start date Start date
B

Brian Morris

Hi,
I have a 2000 MDB that is giving a strange problem when it is run under
Access2002/XP (full version) on Win2000/XP. If I run the 2000 MDB under
Access2000 I don't get the problem. I have a main form with 2 subforms and
from within an update event of subformA I want to set the focus to subformB.
In Access2000 I do the following and it works fine but not in AccessXP it
gives an error

Private Sub subfromATxtBox_AfterUpdate()
Parent!subfrmB.SetFocus
End Sub

Also whenever I add a new record in subformA I change the recordsource of
subformB by
Parent!subfrmB.Form.RecordSource = "SELECT * FROM tmpApprLoanPieces WHERE
(PartNo = " & Me.txtPartNo & ");"

the error...
Run-time error 3011
The expression After Update you entered as the event property setting
produced the following error: The Microsoft jet database engine could not
find the object ~sq_fsubfrmB. Make sure the object exists and that you spell
its name and the path name correctly. The expression may not result in the
name of a macro, the name of a user-defined function or [Event Procedure],
There may have been an error evaluating the function, event or macro.

When the error message comes up, I trap it and ask the user to press ok and
it does eventually give the focus to the subform and everything appears to
be ok but I don't want to leave it like this.

I tried converting to 2002 format and recompiling but that did not help.
I've turned off the Name AutoCorrect and recompacted and if tried
Forms!ParentFormName!subformB.SetFocus instead of
Parent!subfrmB.SetFocus but I get the same result.

Forgive my repost.
Thanks
Brian
 
Gina,
The KB does not indicate if this also applys in Access2002. Note that I
don't get the problem in 2000 at all, only in 2002.
Thanks
Brian

Gina said:
Try http://support.microsoft.com/default.aspx?scid=kb;en-
us;237592&Product=acc2000

Hope that helps!
Gina
-----Original Message-----
Hi,
I have a 2000 MDB that is giving a strange problem when it is run under
Access2002/XP (full version) on Win2000/XP. If I run the 2000 MDB under
Access2000 I don't get the problem. I have a main form with 2 subforms and
from within an update event of subformA I want to set the focus to subformB.
In Access2000 I do the following and it works fine but not in AccessXP it
gives an error

Private Sub subfromATxtBox_AfterUpdate()
Parent!subfrmB.SetFocus
End Sub

Also whenever I add a new record in subformA I change the recordsource of
subformB by
Parent!subfrmB.Form.RecordSource = "SELECT * FROM tmpApprLoanPieces WHERE
(PartNo = " & Me.txtPartNo & ");"

the error...
Run-time error 3011
The expression After Update you entered as the event property setting
produced the following error: The Microsoft jet database engine could not
find the object ~sq_fsubfrmB. Make sure the object exists and that you spell
its name and the path name correctly. The expression may not result in the
name of a macro, the name of a user-defined function or [Event Procedure],
There may have been an error evaluating the function, event or macro.

When the error message comes up, I trap it and ask the user to press ok and
it does eventually give the focus to the subform and everything appears to
be ok but I don't want to leave it like this.

I tried converting to 2002 format and recompiling but that did not help.
I've turned off the Name AutoCorrect and recompacted and if tried
Forms!ParentFormName!subformB.SetFocus instead of
Parent!subfrmB.SetFocus but I get the same result.

Forgive my repost.
Thanks
Brian


.
 
Brian,

I searched the Knowledge Base for the error number under Access and that's
what it came up with. I tried the search under just Access 2002 but nothing
came up. Oddly enough the error message is the same whether 2000 or 2002
which is why I thought that article might help. Sorry it was of no use.

Gina


Gina,
The KB does not indicate if this also applys in Access2002. Note that I
don't get the problem in 2000 at all, only in 2002.
Thanks
Brian

Gina said:
Try http://support.microsoft.com/default.aspx?scid=kb;en-
us;237592&Product=acc2000

Hope that helps!
Gina
-----Original Message-----
Hi,
I have a 2000 MDB that is giving a strange problem when it is run under
Access2002/XP (full version) on Win2000/XP. If I run the 2000 MDB under
Access2000 I don't get the problem. I have a main form with 2 subforms and
from within an update event of subformA I want to set the focus to subformB.
In Access2000 I do the following and it works fine but not in AccessXP it
gives an error

Private Sub subfromATxtBox_AfterUpdate()
Parent!subfrmB.SetFocus
End Sub

Also whenever I add a new record in subformA I change the recordsource of
subformB by
Parent!subfrmB.Form.RecordSource = "SELECT * FROM tmpApprLoanPieces WHERE
(PartNo = " & Me.txtPartNo & ");"

the error...
Run-time error 3011
The expression After Update you entered as the event property setting
produced the following error: The Microsoft jet database engine could not
find the object ~sq_fsubfrmB. Make sure the object exists and that you spell
its name and the path name correctly. The expression may not result in the
name of a macro, the name of a user-defined function or [Event Procedure],
There may have been an error evaluating the function, event or macro.

When the error message comes up, I trap it and ask the user to press ok and
it does eventually give the focus to the subform and everything appears to
be ok but I don't want to leave it like this.

I tried converting to 2002 format and recompiling but that did not help.
I've turned off the Name AutoCorrect and recompacted and if tried
Forms!ParentFormName!subformB.SetFocus instead of
Parent!subfrmB.SetFocus but I get the same result.

Forgive my repost.
Thanks
Brian


.
 
Thanks for the help anyway.
Brian
Gina Whipp said:
Brian,

I searched the Knowledge Base for the error number under Access and that's
what it came up with. I tried the search under just Access 2002 but nothing
came up. Oddly enough the error message is the same whether 2000 or 2002
which is why I thought that article might help. Sorry it was of no use.

Gina


Gina,
The KB does not indicate if this also applys in Access2002. Note that I
don't get the problem in 2000 at all, only in 2002.
Thanks
Brian

Gina said:
Try http://support.microsoft.com/default.aspx?scid=kb;en-
us;237592&Product=acc2000

Hope that helps!
Gina
-----Original Message-----
Hi,
I have a 2000 MDB that is giving a strange problem when
it is run under
Access2002/XP (full version) on Win2000/XP. If I run the
2000 MDB under
Access2000 I don't get the problem. I have a main form
with 2 subforms and
from within an update event of subformA I want to set the
focus to subformB.
In Access2000 I do the following and it works fine but
not in AccessXP it
gives an error

Private Sub subfromATxtBox_AfterUpdate()
Parent!subfrmB.SetFocus
End Sub

Also whenever I add a new record in subformA I change the
recordsource of
subformB by
Parent!subfrmB.Form.RecordSource = "SELECT * FROM
tmpApprLoanPieces WHERE
(PartNo = " & Me.txtPartNo & ");"

the error...
Run-time error 3011
The expression After Update you entered as the event
property setting
produced the following error: The Microsoft jet database
engine could not
find the object ~sq_fsubfrmB. Make sure the object exists
and that you spell
its name and the path name correctly. The expression may
not result in the
name of a macro, the name of a user-defined function or
[Event Procedure],
There may have been an error evaluating the function,
event or macro.

When the error message comes up, I trap it and ask the
user to press ok and
it does eventually give the focus to the subform and
everything appears to
be ok but I don't want to leave it like this.

I tried converting to 2002 format and recompiling but
that did not help.
I've turned off the Name AutoCorrect and recompacted and
if tried
Forms!ParentFormName!subformB.SetFocus instead of
Parent!subfrmB.SetFocus but I get the same result.

Forgive my repost.
Thanks
Brian


.
 
Back
Top