I've fallen foul of the 'DLookup is slow as hell' issue for a loop that I've coded. Whilst I can find plenty of references that alternative to DLookup exist, I've found nothing that explicity says how they work!
Following information from this link, I'm assuming that the ideal solution uses seek or some find variant.
The following code is used on a form to reset fileds used for filtering. I'm sure that there are more elegent solution to this partiular problem (which I would also be interested in hearing), but I'm specifically interested in the concept of the DLookup alternative and would like to see how that would be applied to this scenario.
Thanks
Stuart
Following information from this link, I'm assuming that the ideal solution uses seek or some find variant.
The following code is used on a form to reset fileds used for filtering. I'm sure that there are more elegent solution to this partiular problem (which I would also be interested in hearing), but I'm specifically interested in the concept of the DLookup alternative and would like to see how that would be applied to this scenario.
Code:
'For each record in table, set value of filter-fields on form to null
For n = 1 To m
Me.Controls("Filter_" & DLookup("Field", "tblFilterSetup", "ID = " & n)) = Null
On Error Resume Next 'if there is no record with that ID, continue
Next n
Thanks
Stuart