edit value with click/after update event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have created a list that displays certains information. I would like to create a "afterupdate" action that will check and uncheck the "Include in report" field associated with the specific record that the user clicks on. Thus the user can simply click each record in the list to check or uncheck it. I guess I would need some way of requerying the listbox in the "afterupdate" code

this what I have so far but it doesn't wor

Dim rs As Objec
Set rs = Me.Recordset.Clon
rs.FindFirst "[EntryNumber] = " & Str(Me![List2]
If rs.Fields("Include In Report") = False The
With r
.Edi
.Fields("Include In Report") = Tru
End Wit
Els
With r
.Edi
.Fields("Include In Report") = Fals
End Wit
End I
Set rs = Nothin
Me.List2.Requer

thank you for your help

Danie
 
You might try

Dim rs As Object
Set rs = Me.RecordsetClone 'vice me.recordset.clone

With rs
.FindFirst "[EntryNumber] = " & Str(Me![List2])
If .NoMatch = False then
.Edit
.Fields("Include In Report") = Not(.Fields("Include In Report"))
.Update 'you need UPDATE to commit the action
End If
End With

Set rs = Nothing
Me.List2.Requery
 
Back
Top