control source problem

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!
 
P

PC Datasheet

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top