I think this might be fairly simple, but I'm at a loss as to how to do it. In a report, I want to set a text box's record source to the value of a field name in another table like this:
CurrentData.ControlSource = DLookup("[CurrentTEC]", "[tblCurrentTEC]")
There are times when the value of "CurrentTEC" does not correspond to a field name in the query that the report is based on, so I get a runtime error 3070.
I just need to know how to put some error checking into the VB to set the control source ONLY IF the field name exists in the current query that the report is based on.
Thanks.
CurrentData.ControlSource = DLookup("[CurrentTEC]", "[tblCurrentTEC]")
There are times when the value of "CurrentTEC" does not correspond to a field name in the query that the report is based on, so I get a runtime error 3070.
I just need to know how to put some error checking into the VB to set the control source ONLY IF the field name exists in the current query that the report is based on.
Thanks.