Hi,
Trying use ELookup within a function, using multiple times and easier to pass values and alos do some test on the data. However not really seen this done (Perhaps a bad idea) so struggling to see how the values should be referenced quotes, single quotes etc.
DLookup works as below (But want more speed as lots used on form)
I get too few parameters, I guess something in the where is not correctly held in " or 's btu not sure when passing a value.
The SQLdate this is something I picked up as have the usual problems with the US & UK dd/mm/yyyy & mm/dd/yyyy swapping thing, as this fixes it, so not really declared as date & left as is.
Public Function EPLIsBooked(EPLReturn As String, BookedDate As String, EPLDate As String, EPLEmail As String)
If IsNull(EPLDate) Then Exit Function
To Few Parameters
EPLIsBooked = ELookup(EPLReturn, "Dogs", BookedDate & " = " & SQLDate(EPLDate) & " AND Email = " & EPLEmail)
Works OK
EPLIsBooked = DLookup(EPLReturn, "[Dogs]", BookedDate & " = " & SQLDate(EPLDate) & " AND Email = " & EPLEmail)
End Function
Trying use ELookup within a function, using multiple times and easier to pass values and alos do some test on the data. However not really seen this done (Perhaps a bad idea) so struggling to see how the values should be referenced quotes, single quotes etc.
DLookup works as below (But want more speed as lots used on form)
I get too few parameters, I guess something in the where is not correctly held in " or 's btu not sure when passing a value.
The SQLdate this is something I picked up as have the usual problems with the US & UK dd/mm/yyyy & mm/dd/yyyy swapping thing, as this fixes it, so not really declared as date & left as is.
Public Function EPLIsBooked(EPLReturn As String, BookedDate As String, EPLDate As String, EPLEmail As String)
If IsNull(EPLDate) Then Exit Function
To Few Parameters
EPLIsBooked = ELookup(EPLReturn, "Dogs", BookedDate & " = " & SQLDate(EPLDate) & " AND Email = " & EPLEmail)
Works OK
EPLIsBooked = DLookup(EPLReturn, "[Dogs]", BookedDate & " = " & SQLDate(EPLDate) & " AND Email = " & EPLEmail)
End Function