AndyCompanyZ
Registered User.
- Local time
- Today, 19:56
- Joined
- Mar 24, 2011
- Messages
- 223
I am trying to run two recordset queries that produce different results but from the same table. The first one works but I can't get the second to work I don't know whether I need to run both at the same time or if there is something I need to add:
This is a work round from my other thread for anyone who is following this.
Thanks for any help or advice.
Code:
Dim Rs As DAO.Recordset
Set Rs = CurrentDb.OpenRecordset("Select * From EventDelegate Where DelegateID = " & Me.txtDelegateID & " And EventID = " & Me.cmboEvent)
If Not Rs.EOF And Not Rs.BOF Then
MsgBox "This delegate is already scheduled on this Event", vbExclamation
Exit Sub
Rs.Close
Else
Dim Rs3 As DAO.Recordset
Set Rs3 = CurrentDb.OpenRecordset("Select * From EventDelegate Where DelegateID = " & Me.txtDelegateID & " And EventStartDate = " & Me.txtEventStartDate)
If Not Rs3.EOF And Not Rs3.BOF Then
MsgBox "Already Scheduled for an Event on same day"
Exit Sub
Rs3.Close
End If
End If
This is a work round from my other thread for anyone who is following this.
Thanks for any help or advice.