Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display field in Text box

Status
Not open for further replies.

mmaglio

Programmer
Jun 20, 2003
28
JP
I would like to display a memo-type field in a text box when the user chooses a record from a listbox. The Listbox holds the Primary Key, and the memo field is in the same table as the RowSource of the listbox. I just cant seem to figure out how to get the textbox ouput to display the field right.
Any ideas what should go in the AfterUpdate of the listbox?

Thanks, All
 
Several answers for this based on how you form and list box is set up. If the form is bound to the same table as the list box then you would do it using the boomark property

but here is the way I would do it

set the list box rowsource to include the memo field then in the after update

me!textboxname = me!listboxname.column(1) remember 0 is the first column 1 the 2nd etc..
 
Thanks, Im pretty sure this will work,but how do I set the rowsource to include the memo field? if I try to add it in the RowSource field, I get a message about characters found after the end of and SQL statement, and if I try to update the rowsource in the AfterUpdate of the list box, this doesnt work either.

The list box and textbox are both unbound.

What I am able to do is display the memofield in another list box (by setting its rowsource in the AfterUpdate event0, and when i click in there it displays in the textbox.Obviously, this isnt ideal.

Thanks
 
if you click the rowsource it will display 3 dots
... to the right of the rowsource
click on the 3 dots it will open the query builder
add the memo filed by dragging it to the grid. close the grid then say yes to update when prompted
 
Thanks gol4
Ok, I did that, but it still doesnt happen. I don't get it. this seems like it should be easier.

I can display it in another listbox, though. The problem with that is the words wont all fit in one line of a listbox. Is there a way to make a list box word wrap? This would be a decent alternative to the text box.

Thanks
 
no way I know of to word warp the listbox

rather then trying in the after update event try setting the textboxes controlsource to

=[yourlistboxname].[Column](1)
 
Still missing something...I dont know. Thanks for all the help, Ill tinker around some more tomorrow, and post up the results.

Thanks,

Mark
 
A few things that I took for granted but you need to check
change the listbox column count to 2 and to hide the 2nd colunm set the with to 0 like this
1";0"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top