Viewing expressions in a listbox

P

Peter Stone

Access 2003, XP Pro, semi-novice

I presume that I need to solve this using a query.

I have a table "Expressions" where records are similar to the one below:

=[Preposition] & " " & [Vehicle] & "is" [Color]

I have another table "Words" similar to that below:

Record 1
Preposition: My
Vehicle: Car
Color: Blue

Record 2
Preposition: His
Vehicle: Bicycle
Color: Red

I list the expressions in a list box and select them into a textbox. By
selecting records from table "Words" by a combo box and displaying the fields
in hidden text boxes, I can get the following results in the textbox:

My Car is Red
His Bicycle is Blue

My question is:
Instead of viewing the expression results one-by-one in the textbox, how can
I display them all in a list box.

In case you're wondering why? My expressions are quite different from this:
longer, more complicated, and more varied. I gave this example to keep it
simple.

Thanks

Peter
 
G

Gina Whipp

Peter,

Create your expression in a query and use the query as the recordsource for
your list box.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Access 2003, XP Pro, semi-novice

I presume that I need to solve this using a query.

I have a table "Expressions" where records are similar to the one below:

=[Preposition] & " " & [Vehicle] & "is" [Color]

I have another table "Words" similar to that below:

Record 1
Preposition: My
Vehicle: Car
Color: Blue

Record 2
Preposition: His
Vehicle: Bicycle
Color: Red

I list the expressions in a list box and select them into a textbox. By
selecting records from table "Words" by a combo box and displaying the
fields
in hidden text boxes, I can get the following results in the textbox:

My Car is Red
His Bicycle is Blue

My question is:
Instead of viewing the expression results one-by-one in the textbox, how can
I display them all in a list box.

In case you're wondering why? My expressions are quite different from this:
longer, more complicated, and more varied. I gave this example to keep it
simple.

Thanks

Peter
 
P

Peter Stone

Sorry Gina I simplified it too much; every expression is different. e.g.

=[Preposition] & " " & [Color] & " " & [Vehicle] has a puncture

Your green truck has a puncture

Thanks

Peter
 
P

Peter Stone

Hm. I wasn't paying attention My, Your, and His are, of course, possessive
adjectives not prepositions. Let's continue to make out they are prepositions
for the purpose of solving this.

Peter
 
V

vanderghast

You can none the less create a computed expression in a query, and base you
listbox on that created query, isn't it?


Vanderghast, Access MVP
 

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