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
 
N

news.east.earthlink.net

is this a listbox control? if so............................
in the listbox's recordsource, add the field to be updated to the query. now
you will need to set two properties. the column count and the column widths.
then in the click event of the listbox use this code: (if the added field is
the second column and lets say the controls name is lstRecords),
me.lstRecords.Column(1) = -1 ( -1 is the value for yes in a checkbox).
Daniel P said:
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 work

Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[EntryNumber] = " & Str(Me![List2])
If rs.Fields("Include In Report") = False Then
With rs
.Edit
.Fields("Include In Report") = True
End With
Else
With rs
.Edit
.Fields("Include In Report") = False
End With
End If
Set rs = Nothing
Me.List2.Requery


thank you for your help,

Daniel
 

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

Top