Solved

have text field w/>255 characters in a combobox in Access

Posted on 2008-10-31
18
413 Views
Last Modified: 2012-08-13
I have a query tied to a combobox.  It pulls in the Number, Topic and Text from a single table.  However, once I select the topic that displays in the combobox it is suppose to populate via code the text box.  The textbox is a memo field and data is > than 255 characters.  So how do I get this to work?
0
Comment
Question by:avalonwgi
  • 8
  • 6
  • 4
18 Comments
 
LVL 75
ID: 22852599
Not clear what the problem is ?

Me.YourTextBoxName = Me.YourComboBoxName.Column(2)  

Column numbers are zero based ... 2 would be the Text column in the combo.

mx
0
 
LVL 21

Expert Comment

by:silemone
ID: 22852613
I had a similar problem in Crystal Reports and most often, unfortunately, since the size limit, you may have to truncate the dataString...I also noticed that a Label takes as much as you can throw at it, so that may be the way to go...using a  styled label or even trying to find a way to place a label inside of the combobox...
0
 
LVL 21

Expert Comment

by:silemone
ID: 22852622
besides, memo fields have limitations on their as people sought this as a solution, but was unable to make that work out.
0
 

Author Comment

by:avalonwgi
ID: 22852671
DatabaseMX,
Thanks, but that part I have and works fine.  THe text data in column(2) is pulling in a memo field that has > 255 characters, however it only populates in the me.textbox only the first 255 characters.  Does that help?
0
 
LVL 75
ID: 22852707
Text boxes can had more than 255 characters. Set the text box's Enter Key Behavior property to

'New Line in Field' ... and Scroll Bars to Vertical.

mx

0
 
LVL 75
ID: 22852710
Make the 'Can HOLD ...'

mx
0
 
LVL 75
ID: 22852717
This issue may be that the Combo box column cannot hold more than 255 characters ... which I think is the case.

mx
0
 

Author Comment

by:avalonwgi
ID: 22852734
Databasemx,
so in response to your last posting, let's say there is a limit on the characters per column.  How would you recommend getting that data selected and then populated into the text box?
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 22852818
Well, I suppose you could ... make the selection with the combo (get rid of the Text col) ... then do a DLookup in the table and return the full text, then populate your text box.

mx
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:avalonwgi
ID: 22852940
Let me give that a try later today as I have meetings the rest of the afternoon.  Thanks DatabaseMX

Dave
0
 
LVL 21

Expert Comment

by:silemone
ID: 22852960
i sort of stated gave you the answer that these other controls have limits except for the Label...anyway...good luck...
0
 
LVL 21

Expert Comment

by:silemone
ID: 22852964
you can set the label Text = ..........................
0
 
LVL 75
ID: 22852999
"you can set the label Text = .........................."

Huh ?

mx
0
 
LVL 21

Expert Comment

by:silemone
ID: 22853114
I'm saying a Label is a control that doesn't have a limit and '...' usually stands for infinitely (a gross exaggeration, but point is Label control can take a larger amount of text than most controls) a large amount of characters...but i don't see how it could work if he's using a textbox which has a length limit of 255 unless he takes major precautions to truncate...Unless he has to exit data in Textbox, I was explaining maybe a label would be the way to go...
0
 
LVL 21

Expert Comment

by:silemone
ID: 22853119

exit  = edit
0
 
LVL 75
ID: 22853265
"textbox which has a length limit of 255 "

No.  An Access Text box does *not* have a limit of 255.  I can in fact hold a Memo field's worth of data.

The issue is with the combo box Column truncating the field's data.

mx
0
 

Author Comment

by:avalonwgi
ID: 22854597
DatabaseMX is correct.  THe issue is with the combobox column truncating the fields data.  So are you able to load a combobox with a column being a memo field and not have it truncate the data when you put it to a textbox on the form after selecting?  Dave
0
 
LVL 75
ID: 22854625
"So are you able to load a combobox with a column being a memo field and not have it truncate the data"

Not that I can see. It's a limitation of the combo box  (columns).  Try the DLookup approach to get the memo text.

mx
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now