J
John Phelan
When I use FMS, “Total Access Analyzer†I get a report with a list of,
“Performance Items†that includes a reference to the use of, “DLookupâ€:
“Module Domain Functions in Code
Domain functions such as DLookup, DMin, Max, etc are often slower than an
equivalent saved query, Where possible, consider replacing Domain functions
with saved queries that are optimized for performance.â€
How do you replace the Domain Function, DLookup, below, with a saved query,
sited in the performance report?
Private Function TipImg(sColor, vGuestID) As String
On Error GoTo ErrLine
Dim sTemp As String, sRet As String
Select Case sColor
Case "N": sTemp = "Incomplete Entry"
Case "R": sTemp = "Fixed Reservation"
Case "B": sTemp = "Normal Reservation"
Case "G": sTemp = "Paid Reservation or Occupancy"
Case "Y": sTemp = "Unit is Unavailable"
Case "P": sTemp = "Normal Occupancy"
End Select
TipImg = sRet & vbCrLf & sTemp
ExitLine:
Exit Function
ErrLine:
Resume ExitLine
End Function
- John
“Performance Items†that includes a reference to the use of, “DLookupâ€:
“Module Domain Functions in Code
Domain functions such as DLookup, DMin, Max, etc are often slower than an
equivalent saved query, Where possible, consider replacing Domain functions
with saved queries that are optimized for performance.â€
How do you replace the Domain Function, DLookup, below, with a saved query,
sited in the performance report?
Private Function TipImg(sColor, vGuestID) As String
On Error GoTo ErrLine
Dim sTemp As String, sRet As String
sRet = DLookup("Name", "qryGuestName", "GuestID = " & vGuestID)
Select Case sColor
Case "N": sTemp = "Incomplete Entry"
Case "R": sTemp = "Fixed Reservation"
Case "B": sTemp = "Normal Reservation"
Case "G": sTemp = "Paid Reservation or Occupancy"
Case "Y": sTemp = "Unit is Unavailable"
Case "P": sTemp = "Normal Occupancy"
End Select
TipImg = sRet & vbCrLf & sTemp
ExitLine:
Exit Function
ErrLine:
Resume ExitLine
End Function
- John