I first need to explain what I had working well in Access 2007.
Pt_Data form has one text-box named txtPP. There's a button labeled Prescribe which opens another form frmSelection. The selection form has 3 list boxes listing 1)Antibiotics, 2)NSAIDS and 3)Miscellaneous. What I did was select the required medications from each of the list-boxes, gathered them in a string variable, adding a vbCrLf after each selection so that I have something like this for prescription:
- Tab. Cefixime 200mg
- Tab. Diclofenac 50mg
- Tab. Metoclopramide
This entire text would be then copied to the txtPP in Pt_Data form on hitting the OK button on the frmSelection form.
After upgrading to Access 2010, I found there is a very nice addition of converting the textbox to Rich Text so as to enable one to format the words individually in the text-box. I find this is useful in order to stress some medication or some instruction in the PP text-box. So I converted the PP text box property to Rich Text. The code is the same. BUT now when I press the OK btn on the frmSelection after selecting the items, the string does get pasted into the txtPP but vbCrLf is gone! Vanished. The text appears thus:
- Tab. Cefixime 200mg - Tab. Diclofenac 50mg - Tab. Metoclopramide
On checking the code, vbCrLf is still there! I tried changing it to vbNewline, to Chr(13) & Chr(10) etc. But still the same behavior. It seems the carriage return and linefeed gets trimmed in the rich text. If I change the property back to plain text, I get everything back to what I wanted.
Can anyone explain to me this odd behavior? What is the workaround? OR what am I doing wrong?
Thanks.
Pt_Data form has one text-box named txtPP. There's a button labeled Prescribe which opens another form frmSelection. The selection form has 3 list boxes listing 1)Antibiotics, 2)NSAIDS and 3)Miscellaneous. What I did was select the required medications from each of the list-boxes, gathered them in a string variable, adding a vbCrLf after each selection so that I have something like this for prescription:
- Tab. Cefixime 200mg
- Tab. Diclofenac 50mg
- Tab. Metoclopramide
This entire text would be then copied to the txtPP in Pt_Data form on hitting the OK button on the frmSelection form.
After upgrading to Access 2010, I found there is a very nice addition of converting the textbox to Rich Text so as to enable one to format the words individually in the text-box. I find this is useful in order to stress some medication or some instruction in the PP text-box. So I converted the PP text box property to Rich Text. The code is the same. BUT now when I press the OK btn on the frmSelection after selecting the items, the string does get pasted into the txtPP but vbCrLf is gone! Vanished. The text appears thus:
- Tab. Cefixime 200mg - Tab. Diclofenac 50mg - Tab. Metoclopramide
On checking the code, vbCrLf is still there! I tried changing it to vbNewline, to Chr(13) & Chr(10) etc. But still the same behavior. It seems the carriage return and linefeed gets trimmed in the rich text. If I change the property back to plain text, I get everything back to what I wanted.
Can anyone explain to me this odd behavior? What is the workaround? OR what am I doing wrong?
Thanks.