referencing subforms in AccessXP

  • 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 access 2000 I do the
following and it works fine but not in access XP
Private Sub subfromATxtBox_AfterUpdate()
Parent!subfrmB.SetFocus
End Sub

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.

I tried converting to 2002 format and recompiling but that did not help.

Thanks
Brian
 
Thanks for the responses, but no luck. I did both suggestions and it made
no difference it still works fine under 2000 but error in XP.
I don't know if this will give you any more ideas but 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 that. Also, by default the recordsource of the subformB is a
stored query, but under certain conditions I change it by
Parent!subfrmB.Form.RecordSource = "SELECT * FROM tmpApprLoanPieces WHERE
(PartNo = " & Me.txtPartNo & ");"
I don't change the name of the query or anything else.

Thanks
Brian
 
Back
Top