N
nouveauricheinvestments
Hi,
I'm have a subform that displays records in a table. In this table,
there is a boolean field called 'SelectTicket'. I have attached the
following code to the subform that should only allow the user to ever
select one record as being true. It doesn't work though. Any ideas
what I am doing wrong? I'm not very good with access coding yet.
Thanks
Private Sub SelectTicket_Click()
Dim strSQL As String
Dim lngKey As String
lngKey = Me!Explanation.Text
strSQL = "UPDATE OpenTicketsSubForm SET SelectTicket=FALSE"
CurrentDb.Execute strSQL, dbFailOnError
Me.Requery
With Me.RecordsetClone
Me.Explanation.SetFocus
.FindFirst Explanation.Text = lngKey
If Not .NoMatch Then
Me.Bookmark = .Bookmark
Me.SelectTicket = True
End If
End With
DoCmd.Close acForm, "ViewSelectedOpenTicket"
Me!SelectTicket.SetFocus
I'm have a subform that displays records in a table. In this table,
there is a boolean field called 'SelectTicket'. I have attached the
following code to the subform that should only allow the user to ever
select one record as being true. It doesn't work though. Any ideas
what I am doing wrong? I'm not very good with access coding yet.
Thanks
Private Sub SelectTicket_Click()
Dim strSQL As String
Dim lngKey As String
lngKey = Me!Explanation.Text
strSQL = "UPDATE OpenTicketsSubForm SET SelectTicket=FALSE"
CurrentDb.Execute strSQL, dbFailOnError
Me.Requery
With Me.RecordsetClone
Me.Explanation.SetFocus
.FindFirst Explanation.Text = lngKey
If Not .NoMatch Then
Me.Bookmark = .Bookmark
Me.SelectTicket = True
End If
End With
DoCmd.Close acForm, "ViewSelectedOpenTicket"
Me!SelectTicket.SetFocus