Personalizing Ms Access error masseges

Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc used Ask the Experts™
on
Hi

My form login in my Ms Access application hide immediately after login in a user because I use it to reference the user name control and store the names of the users and those approving documents in the table  called tblcontrol for purpose of a proper audit trail. Now I want to reference also all the massages so that they become personalized, I have massages like:
 MsgBox “Please check your book keeping entries are not balancing”
Now I want personalize the massage by ensuring that it pick the user name as the starting word like below:
MsgBox “Chris please check your book keeping entries are not balancing”
How can I insert this reference like below within the above message?
Forms!FormName!ControlName.Value
What I want to achieve is that all error messages must be personalised, this will help the users to think psychologically that the system knows exactly what they are doing:
I want to replace the   (MsgBox “Chris please check your keeping entries are not balancing”) with
MsgBox “Forms!FormName!ControlName.Value please check your keeping entries are not balancing”
 but does not work any suggestion here or is there other ways of achieving that?


Regards

Chris
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
Commented:
Chris

Try something like this.
Dim strUserName As String

    strUserName  = Forms!FormName!ControlName.Value

    MsgBox strUserName & “ please check your keeping entries are not balancing”

Open in new window

Ryan ChongSoftware Team Lead
Commented:
I think Norie should use the proper quotes:
“ and ” vs " and "

MsgBox strUserName & " please check your keeping entries are not balancing"

another way is to declare the varialbe: strUserName as a Global Variable, so you only assigned it once after logged in successfully, and reuse it when necessary.
NorieAnalyst Assistant

Commented:
Ryan

No idea where they came from.

Wait, when I look at the code in the question it appears to have the strange quotes and I copied that into my reply.:)
Ryan ChongSoftware Team Lead

Commented:
no worries Norie, I knew sometimes that happens.... just to point out cheers

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial