Msg from table

gstylianou

Registered User.
Local time
Today, 16:56
Joined
Dec 16, 2013
Messages
359
Hello,

I need your help regarding something which is simple for many friends but not for me because of my knowledge in Vba is limited.

In the attached database there are one table (tblVBAMsg) and one form with two command buttons. What i wanted is, by pressing the command button1 to have the message ID: 1, and by pressing the command 2 to take the message ID:2 using vba code.

Is tha possible? Can anyone to modify my attached example?
 

Attachments

Easy enough to do. See attached.

However I can't see the point of saving the messages in a table unless the purpose is to reuse the same messages at various places in your application,
 

Attachments

Easy enough to do. See attached.

However I can't see the point of saving the messages in a table unless the purpose is to reuse the same messages at various places in your application,

Dear friend, first of all i would like to thank you very much,

The reason I would like this solution is because if write a direct message in the Greek language into vba and the Regional Settings of the computer is not in Administrative: Greek, it gives us a message .......bla...bla...bla...(chinese style..)

However, can we present this message as a regular message like the example;

MsgBox "1", vbCritical, "title ...."
 
Dear friend, first of all i would like to thank you very much,

The reason I would like this solution is because if write a direct message in the Greek language into vba and the Regional Settings of the computer is not in Administrative: Greek, it gives us a message .......bla...bla...bla...(chinese style..)

However, can we present this message as a regular message like the example;

MsgBox "1", vbCritical, "title ...."

Ah. It makes total sense now.
All I have to worry about here in the UK is converting dates to US format. Good luck

You can certainly create a function as Gasman has done.
Let me know if you want further assistance with this
 
i modified the table and add another field. also modified gasman code.
you can put msg in greek if office is greek, english msg if not greek. the Locale ID for Greek is 1032. 1033 for EN(std).

see the table and the module.
 

Attachments

Dear friends, thank you all,

I have taken your examples into my consideration, but I still try to do what will ultimately help me most. I have made some changes to the database so I can finally completely avoid the problem with Regional Settings and the language pack of each computer and then, to build a dynamic feature which can work independently of the message language theme within vba.

Regarding the above reason I tried to do the following (unfortunally without any result)

1. I have changed the table name to [tblSysMsg] as well as to the fields names also.

2. I tried to integrate a module (modSysMsg) which will be able to recognize the type & the style of the message which i want to apply in each case(ex. vbInformation + vbOKCancel etc)

I would appreciate the help of the most experienced forum members in order to help me to do the following:

The table [tblSysMsg] includes the following fields:
MsgID: AutoID
mTitle: I would like to enter the Message Title
mBody: The Message details
mStyle: The style of the message (1 = vbQuestion, 2 = vbAbortRetryIgnore etc)
AppliedCode: Includes the code. I tried to add a new module into a vba project for the command recognition (ex. Docmd.OpenForm etc)
fObject: the name of the object (eg Form1) etc

If anyone can help me to implement the requested work so that the messages are displayed correctly and the commands are executed, I believe that will be very helpful as well as for the other forum members.

Thanks
 

Attachments

I wouldn't recommend tying your messages to specific forms - it makes more sense to be able to reuse them

Also, when you start trying to customise the message box this extensively, it makes more sense to create your own message form which does exactly what you want. Suggest you go down that route.

Alternatively try one of the enhanced message box utilities available online.
For example: http://blog.nkadesign.com/2008/ms-access-enhanced-message-box-replacement/

HTH
 

Users who are viewing this thread

Back
Top Bottom