G
Guest
Hi
I'm trying to create a VBA event that will update the value in a field for a "Yes/No" field. Therfore, when the user double-click on the item in my list box, it will change the value form Yes to No or No to Yes. The code I have so far is below. But I can't get it to work and I can't figure out my mistake. Could someone point out my error(s)
Private Sub List2_DblClick(Cancel As Integer
' Find the record that matches the control
'Dim rs As DAO.Recordse
Dim rs As Objec
Set rs = Me.Recordset.Clon
'Set rs = CurrentDb.OpenRecordset("tbl_Risk Assessment"
'With rs.Fields("EntryNumber").SourceFiel
'.FindFirst (Str(Me![List2])
rs.FindFirst "[EntryNumber] = " & Str(Me![List2]
Me.Bookmark = rs.Bookmar
If rs.Fields("Include In Report") = -1 The
With r
.Edi
.Fields("Include In Report") =
End Wit
Els
With r
.Edi
.Fields("Include In Report") = -
End Wit
End I
'End Wit
Set rs = Nothin
Me.List2.Requery 'refresh values displayed in the list box windo
End Su
Dan
I'm trying to create a VBA event that will update the value in a field for a "Yes/No" field. Therfore, when the user double-click on the item in my list box, it will change the value form Yes to No or No to Yes. The code I have so far is below. But I can't get it to work and I can't figure out my mistake. Could someone point out my error(s)
Private Sub List2_DblClick(Cancel As Integer
' Find the record that matches the control
'Dim rs As DAO.Recordse
Dim rs As Objec
Set rs = Me.Recordset.Clon
'Set rs = CurrentDb.OpenRecordset("tbl_Risk Assessment"
'With rs.Fields("EntryNumber").SourceFiel
'.FindFirst (Str(Me![List2])
rs.FindFirst "[EntryNumber] = " & Str(Me![List2]
Me.Bookmark = rs.Bookmar
If rs.Fields("Include In Report") = -1 The
With r
.Edi
.Fields("Include In Report") =
End Wit
Els
With r
.Edi
.Fields("Include In Report") = -
End Wit
End I
'End Wit
Set rs = Nothin
Me.List2.Requery 'refresh values displayed in the list box windo
End Su
Dan