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



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/u8TY5A/tzNLAA/yQLSAA/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/
 


Reply via email to