[AccessD] Application defined or object error.

Gustav Brock gustav at cactus.dk
Sat Mar 17 02:58:50 CDT 2012


Hi Rocky

I've learnt always to do:

Set rst = Me.RecordsetClone

and then proceed with rst.
Would that make a difference?

/gustav

>>> rockysmolin at bchacc.com 17-03-12 1:26 >>>
Dear List:
 
(This is Access 2003, BTW).  I have a main form and sub form.  Sub form is
named LotSearchFMLotControlSDS.
 
There are two fields on the sub form (among others -) Variety and Lot.
 
There are two combo boxes on the main form - Select Variety and Select Lot.
The user's selection should position the bus form at the first occurrence of
the selected record.
 
Select Variety works, Select Lot does not.
 
In the After Update event of Select Variety:
    Call Me.LotSearchFMLotControlSDS.Form.FindVariety

and in the sub form LotSearchFMLotControlSDS I have 
 
Public Sub FindVariety()
    Me.RecordsetClone.FindFirst "VarietyID = " &
Forms!LotSearchFM!cboSelectVariety.Column(0)
    If Me.RecordsetClone.NoMatch = False Then Me.Bookmark =
Me.RecordsetClone.Bookmark
End Sub

and that works.
 
In the After Update event of Select Lot:
 
    Call Me.LotSearchFMLotControlSDS.Form.FindLot

and that throws the Application defined or object error.
 
In the sub form LotSearchFMLotControlSDS I have 
 
Public Sub FindLot()
    Me.RecordsetClone.FindFirst "LotID = " &
Forms!LotSearchFM!cboLot.Column(0)
    If Me.RecordsetClone.NoMatch = False Then Me.Bookmark =
Me.RecordsetClone.Bookmark
End Sub

I can't see why one would work and one not.
 
Any ideas?
 
MTIA
 
Rocky Smolin
Beach Access Software
858-259-4334
www.bchacc.com <http://www.bchacc.com/> 
www.e-z-mrp.com <http://www.e-z-mrp.com/> 
Skype: rocky.smolin



More information about the AccessD mailing list