C
Cheese_whiz
Hiyas,
I often use select queries in the rowsource for combo boxes to display
people's names. That happens often in most of the apps I build as I'd think
would be fairly common.
Anyway, mostly I get the names in the combo box by typing an expression
within the select query based on the table where those records are stored.
For example:
Select EntityID, Trim([LastName] & ", " & [FirstName] & " " & [MiddleName])
from EntityTable Where ... Order by....
If I put that expression in a query, could I use it for ANY combo box in the
application for the rowsource? Do developers just make a seperate query for
something like this or just use an existing query even if it has tons of
fields as long as it has the ones you need for the expression?
I have the same issues/question about calculated fields. Often, I just type
code into vba or into the default value of a control on a form to display a
calculated field. Would it be better to just add an expression to a query
being used as the recordsource for the form where the calculated field will
be displayed, or even MAKE a query that would include just the table that's
currently used as the recordsource PLUS the expression needed for the
calculated field?
I'm just thinking I'm wasting time retyping some of this
stuff...particularly the combo box select queries where I think I could
substitute the name of the expression from a query for the expression
itself...
Does that make sense? Any feedback?
Thanks,
CW
I often use select queries in the rowsource for combo boxes to display
people's names. That happens often in most of the apps I build as I'd think
would be fairly common.
Anyway, mostly I get the names in the combo box by typing an expression
within the select query based on the table where those records are stored.
For example:
Select EntityID, Trim([LastName] & ", " & [FirstName] & " " & [MiddleName])
from EntityTable Where ... Order by....
If I put that expression in a query, could I use it for ANY combo box in the
application for the rowsource? Do developers just make a seperate query for
something like this or just use an existing query even if it has tons of
fields as long as it has the ones you need for the expression?
I have the same issues/question about calculated fields. Often, I just type
code into vba or into the default value of a control on a form to display a
calculated field. Would it be better to just add an expression to a query
being used as the recordsource for the form where the calculated field will
be displayed, or even MAKE a query that would include just the table that's
currently used as the recordsource PLUS the expression needed for the
calculated field?
I'm just thinking I'm wasting time retyping some of this
stuff...particularly the combo box select queries where I think I could
substitute the name of the expression from a query for the expression
itself...
Does that make sense? Any feedback?
Thanks,
CW