AccessError(DataErr) contains @ symbol

S

S.L.

Hi, My Form_Error uses AccessError(DataErr) to display message. But message
always contain symbol like @ or @@1. I think these symbols normally
replaced by some word if displayed directly under control of MS Access
itself.

So, Can AccessError(DataErr) capture the correct message ?

TIA
 
D

Douglas J. Steele

Why are you using AccessError? Why not just use the Description property of
the error object?
 
P

Paul Martin

Hi,

I think you'll find that the @ symbol used in a
messagebox are a throw-back to when Access had its own
version of Basic code. It would allow you to format the
text in the messagebox so that the first line was in
bold, and would put a new line in at the end of that.
Unfortunatately, this doesn't function in VBA code, so
the @ symbol is simply displayed. Personally, I did a
Find & Replace to replace the @ symbol with " & vbCrlf
& ", so that it was at least spaced correctly.
There is a workaround to this problem at:
http://www.mvps.org/access/bugs/bugs0035.htm which may
help, personally I haven't tried it yet (to be honest I
was concerned if it would work or not in a runtime
environment).
Hope this is of some help.
Regards,
Paul
 
S

S.L.

Hi, In Form_Error , Access give me only DataErr. Err.Description return ""
and Err.Number return 0.

Or you have some method to get message ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top