Good morning all
I have a database I look after that I inherited sometime ago from the original creator who is no longer available for advice
recently a user has asked for a modification to said database that necessitates a modification to an existing DLookup statement to add a second criteria and for the life of me I can't get it to work, however I can create a query and find the relevant value from the relevant table and the SQL looks like this
SELECT [myTable].[myValue]
FROM [myTable]
WHERE (([Criteria1]=[Form]![Value1]) AND ([Criteria2]=[Form]![Value2]));
The Dlookup statement is inside a macro that fires when the form control (dropdown box) Value2 is selected, it works fine with a single criteria but not with 2, single criteria Dlookup below
DLookUp("[myValue]","[myTable]","[Critera1]=Form![Value1]")
How would I go about getting the output from my SQL statement above from a Dlookup statement to use in a macro.
Thank you
I have a database I look after that I inherited sometime ago from the original creator who is no longer available for advice
recently a user has asked for a modification to said database that necessitates a modification to an existing DLookup statement to add a second criteria and for the life of me I can't get it to work, however I can create a query and find the relevant value from the relevant table and the SQL looks like this
SELECT [myTable].[myValue]
FROM [myTable]
WHERE (([Criteria1]=[Form]![Value1]) AND ([Criteria2]=[Form]![Value2]));
The Dlookup statement is inside a macro that fires when the form control (dropdown box) Value2 is selected, it works fine with a single criteria but not with 2, single criteria Dlookup below
DLookUp("[myValue]","[myTable]","[Critera1]=Form![Value1]")
How would I go about getting the output from my SQL statement above from a Dlookup statement to use in a macro.
Thank you