Would someone please tell me how I can fill a text box with the first of multiple matches based on sql statement comparing multiple values and setting order on the field to be returned as alphabetical?
something similar to
txtWrecker.value = DLookup("Wrecker", "Wreckers", "[County] = [cmbCounty] AND [Size] = [cmbSize] AND [Area] = [cmbArea] AND [Rotate] = False ORDERBY [Wrecker]")
I want the user to select a value from 3 combo boxes on the current form (cmbCounty, cmbSize, cmbArea) and then return the first instance of Wrecker (sorted alphabetically) from tabled named Wreckers where the Rotate field is false.
I have read up on Dlookup, Select First, and Select Min but can't seem to get it tweaked just right. I think the Dlookup would be the right path, but I need some help...
Bob
something similar to
txtWrecker.value = DLookup("Wrecker", "Wreckers", "[County] = [cmbCounty] AND [Size] = [cmbSize] AND [Area] = [cmbArea] AND [Rotate] = False ORDERBY [Wrecker]")
I want the user to select a value from 3 combo boxes on the current form (cmbCounty, cmbSize, cmbArea) and then return the first instance of Wrecker (sorted alphabetically) from tabled named Wreckers where the Rotate field is false.
I have read up on Dlookup, Select First, and Select Min but can't seem to get it tweaked just right. I think the Dlookup would be the right path, but I need some help...
Bob