Unbound text box truncating text

gddrew

Registered User.
Local time
Today, 11:34
Joined
Mar 23, 2005
Messages
38
I'm using a form with a combo box bound to a table (but all other boxes are not bound). When the user selects from the combo box, the other fields on the form populate.

The problem is, there are two fields which are memo fields, but the form is truncating the text. When I type text in the form and save, it truncates, but in the table itself the text is not truncated. However, if I go back to the form and make a change, the truncated text overwrites what's in the table.
 

Attachments

  • Unbound.jpg
    Unbound.jpg
    69.6 KB · Views: 165
Last edited:
It only truncates the memo field if you:

- sort on the field
- group by the field in a Totals query
- specify a Format on the field

If you don't do any of these things, you should see the full memo
field. Just including it in a Query does NOT truncate it.

I don't do any of those things and it still comes in truncated. As a matter of fact, when I fill out a blank form and save the record, the text truncates.
 
I it also truncates if you use SELECT DISTINCT, or UNION.
 
Here is the RowSource query from the Properties of the combobox (named cboProject):

Code:
SELECT tblRequirement.ID, tblRequirement.ProjectNumber,
tblRequirement.ProjectName,
tblRequirement.DevCenter,
tblRequirement.DeliverableName, <--- THIS IS DEFINED AS A MEMO FIELD IN tblRequirement
tblRequirement.OriginalEstimateAmt,
tblRequirement.CurrentEstimateAmt,
tblRequirement.ResourceType,
tblRequirement.Comment <--- THIS IS DEFINED AS A MEMO FIELD IN tblRequirement
FROM tblRequirement
ORDER BY tblRequirement.ProjectName, tblRequirement.DevCenter;

This is the code for the AfterUpdate function for the combobox:

Code:
Private Sub cboProject_AfterUpdate()

   '--- Display the record locked warning.
   Label78.Visible = True
   
   '--- bring data into form once a project is selected
   txtProjectNbr = cboProject.Column(1)
   txtProjectNm = cboProject.Column(2)
   txtDevCtr = cboProject.Column(3)
   txtDeliv = cboProject.Column(4) <--- THIS IS DEFINED AS A MEMO FIELD IN tblRequirement
   txtOrigEstAmt = cboProject.Column(5)
   txtCurrEstAmt = cboProject.Column(6)
   txtResType = cboProject.Column(7)
   txtComment = cboProject.Column(8) <--- THIS IS DEFINED AS A MEMO FIELD IN tblRequirement
   txtID = cboProject.Column(0)
   
   '--- Disable the individual field update options
   lblUpdate1.Visible = False
   lblUpdate2.Visible = False
   
   '--- lock the text boxes
   txtProjectNbr.Locked = True
   txtProjectNm.Locked = True
   txtDevCtr.Locked = True
   txtDeliv.Locked = True
   txtOrigEstAmt.Locked = True
   txtCurrEstAmt.Locked = True
   txtResType.Locked = True
   txtComment.Locked = True
   
End Sub

I'm not seeing anything in the SQL statement that would cause the Delivery (txtDeliv) and Comments (txtComment) to truncate.
 
Last edited:
I don't see anything in the SQL either. I wonder if there is a limitation to a ComboBox we're not aware of. Is there a reason you are not using a bound form? It seems as though that would solve your problem.
 
Though I can't find it documented anywhere, there may be a 255 character limit to each column in a combobox. (make note to self to see if same limit applies to a list box). Making this a bound form would solve the problem and save you a ton of code.
 
I'm using an unbound form because I want to be able to select from a single drop-down and have the remaining information from the table automatically display. Also, by using an unbound the records will not get updated until the user clicks Save.
 
All of that can be done with a bound form and you don't need all of the code.
 
Do you have an example? I've looked at the Northwind Database and some other samples, and am not seeing exactly what I'm looking for.
 
With the form bound to your query and all of the controls *except* the ComboBox bound to the field you want displayed then use the wizard to "Find a record on my form based on the value I selected in my combo box."

And for the "Don't save unless I push this button" look at ghudson's Better Mouse Trap

Post back if you need additional assistance.
 
This works really great, RuralGuy. Thanks!
 
Glad I could help. A lot less code involved as well.
 

Users who are viewing this thread

Back
Top Bottom