I created an Email Template Form as taught in the seminar lessons. I created a "Send To" table called EmailSendGroup. "Send To" table has 5 fields. SendGroupID - AutoNumber SendGroupInActive - Yes/No SendGroupGroupName - Short Text: Short Descriptive Name SendGroupGroupDescription - Short Text: Longer description of customers included in the group. SendGroup - Long Text: SQL Statement for the Send To Group
I enter the new records for the send groups via a form. The form works well, and the table looks good.
Then I made some changes to the Email Template Form from class. I changed the To field to an unbound drop-down combo box named SelectSendGroup. SelectSendGroup Row Source = SELECT EmailSendGroup.SendGroupID, EmailSendGroup.SendGoupName, EmailSendGroup.SendGroupDescription, EmailSendGroup.SendGroup, EmailSendGroup.InActive FROM EmailSendGroup WHERE (((EmailSendGroup.InActive)=False));
I added 3 other text boxes to the Email Template table and form.
SendGroupID - Short Text SendGroupName - Short Text SendGroup - Long Text
I added the following to the AfterUpdate and Change events for the SelectSendGroup combo box.
DetailsPrivate Sub SelectSendGroup_AfterUpdate() Me.SendGoupID.value = Me.SelectSendGroup.Column(0) Me.SendGroupName.value = Me.SelectSendGroup.Column(1) Me.SendGroup.value = Me.SelectSendGroup.Column(3) End Sub
DetailsPrivate Sub SelectSendGroup_Change() If Len(Me.SelectSendGroup.Text) > 0 Then SQL = "SELECT EmailSendGroup.SendGroupID, EmailSendGroup.SendGoupName, EmailSendGroup.SendGroupDescription, EmailSendGroup.SendGroup, EmailSendGroup.InActive FROM EmailSendGroup WHERE (((EmailSendGroup.InActive)=False));" Else End If
Me.SelectSendGroup.RowSource = SQL Me.SelectSendGroup.Dropdown End Sub
Everything works fine except the SendGoup field is getting truncated and cutting off at around 230ish characters. If I copy and paste the SQL statement into the field it doesn't get truncated. Can I change something in the code to stop it from truncating?
There are multiple SendGroups that the Email Templates could get sent to and I want the users to be able to mix and match the Templates and SendGoups. We could have 5 (sometimes more) SendGroups for one Email Template. If I have to paste the SQL statement into the template form I will have to make 5 templates, one for each group.
Kevin Yip 12 months ago
A combo box column can only has up to 255 characters. That is the reason your long text field is truncated. Access truncates a long text field, without warning, whenever certain "processing" needs to be done on the long text field, such as the process of putting a long text field inside a combo box. Therefore, your long text field should not be put inside a combo box. You need to retrieve it separately with DLookup or a recordset. After retrieving it, don't put it through any combo box, query, etc.
Amanda McDonaldOP 12 months ago
Thank you, Kevin!!! As soon as I switched it to DLookup it worked great! I searched the internet for at least two hours. I found a lot about truncating long text boxes but nothing that applied and/or fixed my problem. I was sure I had something wrong with my VBA, didn't even come close to putting it together with it being a combo box. Another rough lesson!
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Email Seminar Lessons.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.