I think you've been hearing from both of us today, but I'm Tobi with an eye, and the other guy is Toby with a why! Glad to help! Tobi
-----Original Message----- From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of brazilianbound Sent: Thursday, December 08, 2005 3:34 PM To: AccessDevelopers@yahoogroups.com Subject: [AccessDevelopers] Re: Launching a FindRecord from an event Toby - I stand in Awe of your VB knowledge, it is nothing short of amazing!!! --- In AccessDevelopers@yahoogroups.com, "Hoffman, Tobi K \(DYS\)" <[EMAIL PROTECTED]> wrote: > > Private Sub Doneby_BeforeUpdate(Cancel As Integer) > Dim strCriterias As String > Dim rst As Recordset > Set rst = Me.RecordsetClone > > if not IsNull(Me.txtDoneBy) then > strCriteria = "Doneby = " & Me!Doneby & _ > " AND IsNull(StopTime)" > rst.FindFirst strCriteria > Me.Bookmark = rst.Bookmark > end if > End Sub > > First of all, you need the right test on DoneBy; I've made the > assumption that you have a textbox, txtDoneBy, which holds that value. > > Second, you need both pieces in strCriteria, and your second line simply > drops the DoneBy part and replaces it. Also, you cannot test something > "= Null", use the IsNull() function. > > Tobi > > -----Original Message----- > From: AccessDevelopers@yahoogroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of brazilianbound > Sent: Thursday, December 08, 2005 2:54 PM > To: AccessDevelopers@yahoogroups.com > Subject: [AccessDevelopers] Launching a FindRecord from an event > > > HI guys > > I am attempting to execute a search on a before_Update event. But this > is not working below. > > Basically, when i scan the "Doneby" field, I want it to look in that > field to see if there is a value in it. IF there is a value there and > the "StopTime" field is Null, then search for the value in the "doneby" > field and populate the StopTime & StopDate fields. > > Private Sub Doneby_BeforeUpdate(Cancel As Integer) > Dim strCriterias As String > Dim rst As Recordset > Set rst = Me.RecordsetClone > strCriteria = "Doneby = " & Me!Doneby > strCriteria = "StopTime" = Null > rst.FindFirst strCriteria > Me.Bookmark = rst.Bookmark > End Sub > > > As Always, Grateful, Clayton > > > > > > > > Please zip all files prior to uploading to Files section. > Yahoo! Groups Links > Please zip all files prior to uploading to Files section. Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/