I came across an error I haven't seen before. I have a DLookUp function on a control on a form that works just fine. As is shown here
=DLookUp("Type","ReferenceT","MetricID = '" & [Forms]![MainNavigation]![NavigationSubform].[Form]![EditMetric].[Form]![EMMetricID] & "'")
So, it looks up the Field "Type" form the table "ReferenceT" and then finds the record relating to a particular ID. This works and it shows the value on the screen.
HOWEVER,
when I use the same function and instead change the field to a particular field, it stops working..
=DLookUp("Sub-Type2","ReferenceT","MetricID = '" & [Forms]![MainNavigation]![NavigationSubform].[Form]![EditMetric].[Form]![EMMetricID] & "'")
In fact, what happens is that the control flashes on the screen uncontrollably and doesn't stop.
I try a different field name
=DLookUp("Definition","ReferenceT","MetricID = '" & [Forms]![MainNavigation]![NavigationSubform].[Form]![EditMetric].[Form]![EMMetricID] & "'")
and it works again.
Now, the kicker here is that I have another field name "Sub-Type1" and try that, and AGAIN, it doesn't work.
My thoughts are that the issue lies in the defining of the field name. That DLookUps do not allow field names to take on this naming procedure with "-" or numbers.
Does anyone know if this is true? And if that is the case, then how do you get around this issue without having to rename your fields?
Thanks!