twoplustwo
Registered User.
- Local time
- Today, 01:35
- Joined
- Oct 31, 2007
- Messages
- 507
Hi guys,
I have just read an article in the Wrox Access VBA 2003 book stating that SEEK is way better than FINDLAST if applicalble to your project.
Below is the code I currently use to open a recordset relating to a customer and check the last instance of correspondance.
It does work, I am just curious if there is anything I am missing. The db is split and located on a server, with each member of the team having a FE on their desktop.
I have just read an article in the Wrox Access VBA 2003 book stating that SEEK is way better than FINDLAST if applicalble to your project.
Below is the code I currently use to open a recordset relating to a customer and check the last instance of correspondance.
Code:
Set rsC = db.OpenRecordset("qryContactActions", dbOpenDynaset) 'Set status
rsC.FindLast "CustomerID=" & lngCustomerID
If rsC!ActionType = 1 Then
lblEmail.Caption = "Email sent"
lblEmail.ForeColor = vbBlue
lblEmail.FontSize = 8
ElseIf rsC!ActionType = 2 Then
lblEmail.Caption = "Email received from site"
lblEmail.ForeColor = vbBlue
lblEmail.FontSize = 8
ElseIf rsC!ActionType = 3 Or rsC!ActionType = 4 Then
lblEmail.Caption = "Telephone contact made, see notes"
lblEmail.ForeColor = vbBlue
lblEmail.FontSize = 7
ElseIf rsC!ActionType = 6 Then
lblEmail.Caption = "No further action"
lblEmail.ForeColor = vbBlue
lblEmail.FontSize = 8
Else: lblEmail.Caption = "Email not yet sent"
lblEmail.ForeColor = vbRed
lblEmail.FontSize = 8
End If
Set rsC = Nothing
It does work, I am just curious if there is anything I am missing. The db is split and located on a server, with each member of the team having a FE on their desktop.