Full Version: can't add comments to blank text field
UtterAccess Forums > Microsoft® Access > Access Forms
ebwhittaker
If the Comments area has nothing in it then the following code will NOT put the 'Cancelled' and the 'Date' in the field area - However if there IS something in the Comments field then it WILL Add the Cancelled and the date to it ....
OK, so I give up - Help!
e!Comments = Me!Comments + vbCrLf + "Cancelled" + vbCrLf + Str(Date)
thanks
ed
doctor9
Ed,
would guess that a NULL value in Comments is causing your problem. Try this instead:
Me!Comments = Nz(Me!Comments, "") + vbCrLf + "Cancelled" + vbCrLf + Str(Date)
Hope this helps,
Dennis
ebwhittaker
Well your 'guess' was correct - worked great - thanks - Ed
doctor9
Glad to help!
Dennis
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.