I need help with dsum function. I have a form that the user will filter. At the footer of the form I have a textbox and a button, when the user presses the button I want to change the controlsourse of the textbox but unfortunatly it give me a error saying #Name?
Here is the code:
strLinkCriteria = Me.Filter
strLinkCriteria = Replace(strLinkCriteria, Chr(34), Chr(39))
strLinkCriteria = Replace(strLinkCriteria, "Date()", "GetDate()")
If strLinkCriteria <> "" Then
Text187.ControlSource = DSum("Volume", "QryCommandesDetails_LG_subform_volum", strLinkCriteria)
Else
Text187.ControlSource = DSum("Volume", "QryCommandesDetails_LG_subform_volum")
End If
I've checked the name of the field Volume and the name of the query and they both are correct. What am I missing?
Here is the code:
strLinkCriteria = Me.Filter
strLinkCriteria = Replace(strLinkCriteria, Chr(34), Chr(39))
strLinkCriteria = Replace(strLinkCriteria, "Date()", "GetDate()")
If strLinkCriteria <> "" Then
Text187.ControlSource = DSum("Volume", "QryCommandesDetails_LG_subform_volum", strLinkCriteria)
Else
Text187.ControlSource = DSum("Volume", "QryCommandesDetails_LG_subform_volum")
End If
I've checked the name of the field Volume and the name of the query and they both are correct. What am I missing?