Rocky Smolin
rockysmolin at bchacc.com
Sat Mar 17 07:45:48 CDT 2012
Gustav:
The program actually never gets to the Public Sub FindLot()
It barfs on the call. Here are the two calls -
cboSelectVariety_AfterUpdate() works cboSelectLot_AfterUpdate() fail - and
fails on the line Call Me.LotSearchFMLotControlSDS.Form.FindLot.
Private Sub cboLot_AfterUpdate()
Call Me.LotSearchFMLotControlSDS.Form.FindLot
End Sub
Private Sub cboSelectVariety_AfterUpdate()
Call Me.LotSearchFMLotControlSDS.Form.FindVariety
End Sub
But they're identical in content except for Variety/Lot.
I'm stumped.
Rocky
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Saturday, March 17, 2012 12:59 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Application defined or object error.
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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com