Re: Cycling Through Every Record in a table/subform When the boolean column is selected
- From: nouveauricheinvestments@xxxxxxxxx
- Date: Thu, 11 Dec 2008 13:07:10 -0800 (PST)
On Dec 11, 1:31 pm, nouveauricheinvestme...@xxxxxxxxx wrote:
Hi,
I have a subform based on a recordset. I have a boolean column where
the user can select the checkbox to the left of the record. If the
user selects the checkbox, I want to check to see if the field exactly
to the right (DeptID) equals a field on my form. If it does, then
that fabulous. If not, then I want to uncheck all boolean values in
the table and display a message box. How would I do that?
This is what I have so far and it is giving me the messagebox saying
it is the EOF. What should I do differently?
Public Function ToCheckDept()
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
Dim MySQL As String
MySQL = "SELECT [Pending Tickets].DeptID, [Pending
Tickets].ResearchTicket FROM [Pending Tickets] WHERE [Pending
Tickets].ResearchTicket=True;"
RS.Open MySQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
With RS
If Not .EOF Then
.MoveFirst
Else
MsgBox "It's saying EOF"
Exit Function
End If
End With
Select Case RS.Fields(0)
Case Is = Forms![ViewOpenTickets]![TSDeptID]
Exit Function
Case Else
MsgBox "It is working so far"
End Select
Set RS = Nothing
End Function
.
- Follow-Ups:
- Re: Cycling Through Every Record in a table/subform When the boolean column is selected
- From: nouveauricheinvestments
- Re: Cycling Through Every Record in a table/subform When the boolean column is selected
- References:
- Cycling Through Every Record in a table/subform When the boolean column is selected
- From: nouveauricheinvestments
- Cycling Through Every Record in a table/subform When the boolean column is selected
- Prev by Date: RE: Struggling with calculated field on form
- Next by Date: Re: Tab with 'X' in it - Access 2007
- Previous by thread: Cycling Through Every Record in a table/subform When the boolean column is selected
- Next by thread: Re: Cycling Through Every Record in a table/subform When the boolean column is selected
- Index(es):
Relevant Pages
|