edit value with click/after update event

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
 
J

John Spencer (MVP)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top