control source problem

  • Thread starter Thread starter JeffH
  • Start date Start date
J

JeffH

Hi ,

I have a txtfield defined so that I can display
additional text information from a secondary file
(tblscalers) based on the value of a combobox
(comboscaler) on my form. When I run the form, I get the
wonderful #name?. Any suggestions?


=(SELECT [tblScalers].[name] FROM tblScalers WHERE
((([tblScalers].[Scalernumber])=Forms![frmTrucksItem]!
[comboscaler]));)

Thanks!
 
Use a DLookup function rather than SQL:

=DLookup("[Name]","TblScalers","[ScalerNumber] = " &
Forms!FrmTrucksItem!ComboScaler)

Note: This expression assumes ScalerNumber is numeric. If it is a string, you
need to change the last part of the expression to a string where clause.

Note: Rename your "Name" field; "Name" is a reserved word in Access.
 
Back
Top