I have a form and on the form I have a currency field that I am trying to set the default value for.
My default value code right now is:
=DSum("[Credit]","tblImportedRecords","[RecordDate] = #" & [Forms]![frmAnnualEarningsSummary]![txtEarningsYear] & "#")
But that isn't working because the field RecordDate in table tblImportedRecords is a date field. For example the table may show 2/16/2015 but the form field txtEarningsYear is a text field that may show 2015 on the form.
How can I make the DSum value work? What do I need to change the default value to to make it work?