textbox controlsource

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
i really cant' understand something. In the help it is said that you can use an expression or a SQL statement as controlsource for textbox.
I have an unbound text box on a form. I want this text box shows the values taken from few fields of a table concatenated.
I have tried using the expression generator and nothing happens. Idem building a SQL statement. In any case the result is #name.
Could you provide my some example on how to use SQL statement as controlsource to check where i'm wrong?
I have already builded SQl statement and everything has worked fine...
Thanks,
Rocco
 
I'm not sure what "IT" refers to, in your statement, but you cannot use an
SQL statement as the Control Source of a TextBox. That's why it is not
working for you.

You can use a Field in the Record Source, or an expression. One of the
things you could include in an expression is the builtin DLookup function --
that might seem "rather close" to using an SQL statement, but it is a
function and returns a single value.

Larry Linson
Microsoft Access MVP

rocco said:
Hello,
i really cant' understand something. In the help it is said that you can
use an expression or a SQL statement as controlsource for textbox.
I have an unbound text box on a form. I want this text box shows the
values taken from few fields of a table concatenated.
I have tried using the expression generator and nothing happens. Idem
building a SQL statement. In any case the result is #name.
Could you provide my some example on how to use SQL statement as
controlsource to check where i'm wrong?
 
rocco said:
Hello,
i really cant' understand something. In the help it is said that you
can use an expression or a SQL statement as controlsource for
textbox. I have an unbound text box on a form. I want this text box
shows the values taken from few fields of a table concatenated.
I have tried using the expression generator and nothing happens. Idem
building a SQL statement. In any case the result is #name.
Could you provide my some example on how to use SQL statement as
controlsource to check where i'm wrong?
I have already builded SQl statement and everything has worked fine...
Thanks,
Rocco

Where does it say that in the help? I think you must be misinterpreting
the help text, because you can *not* set the controlsource of a text box
to a SQL statement -- unless they've added this capability in Access
2003, which I haven't installed yet. The controlsource can be set to
the name of a field from the form's recordsource, which may be a table,
query, or SQL SELECT statement, but that's not the same thing at all.

You can set the controlsource to an expression involving the domain
aggregate functions (such as DLookup, DSum, etc.), which often enables
you to get the same effect. If you'd like to describe in more detail
what you're trying to do, we may be able to point you on your way.
 
Back
Top