This DLookup give me a missing syntax error.
Dim strName As String
strName = DLookup("Manufacturer", "ComponentT", "TotalComponent = " & Forms!ProjectF.P_AnchorCmb)
Any idea why?
I've never fully understood when [] are needed but most of the examples you see in explanations of DLookup have then round the field names, also they use ! Not . in the criteria, perhaps you should try a few changes.
Basically, in VBA Code, the Square Brackets are needed around Field/Control names that contain non-Alpha/Numeric characters. Using these, for this purpose, is really ill-advised. The most common violation of this is the use of Spaces in names.
In other uses, such as in Conditional Formatting, or when using the names of Controls in expressions used for the Control Source of an Unbound Control, they are always needed around the names of Controls! Also note that, in these applications, you do not precede the names with the Me. used in VBA Code.
The point linq is that you see examples that do comply with good nameing but still with [] and no comment is made as to when the [] is needed, but from what you say it is no different to any other occasion in SQL or VBA.