I am creating a rolling 12 month report. I have a report with 12 text boxes whose value depends on the month we are in. i.e. current month data is March therefore first text box will be Feb, then Jan, then Dec....etc. I have a form where the user selects the Month to query and the selection is saved as a number 1 for January, 2 for February, etc. The table stores data in 12 separate fields with the field name 01,02,03,04...etc.
because the text boxes display the previous month and then descend, I need to use a Dlookup to ensure that they are listed in the correct order depending on the month selected by the user. Will someone please provide me the correct verbiage for a Dlookup that follows this logic:
=Dlookup("[column name]","TABLE","[Column Name] = " & comboBox)
as a reference, I was successful with the labels by actually using text boxes and the code(the code was a bit more complicated but you get the idea):
Dlookup("[MonthShort]","MOY", "[MonthNumber] =" & [FORMS]![FORM1]![monthCombo])