Solved msg box vlookup

TipsyWolf

Member
Local time
Today, 02:47
Joined
Mar 20, 2024
Messages
245
hey guys, hope u r doing well today.
i have a vba code with dialog pop up like

Code:
If Me.DueDate < Date Then
    rtn = MsgBox("Due date is in the past. Verify this is correct. If correct select OK if not select CANCEL", vbOKCancel, "Verify Date")

so i created a table
1725989478147.png


1725989527210.png


how do i vlookup non-english txt it in my vba ? i know there is no vlookup in access, but still though
 

Attachments

  • 1725989502108.png
    1725989502108.png
    12.4 KB · Views: 13
You would use DLookup in Access

You can use non-English text in the VBE and in message boxes as long as it is based on Latin character sets e.g. German, Spanish, Italian but not languages such as Japanese, Bengali, Arabic.

However my FormattedMagBox example app can also handle Unicode characters:

For example:
1725990150543.png
 
However my FormattedMagBox example app can also handle Unicode characters:
i've looked at it and either i didn't find it or just simple didn't get it.

isn't the simple way to do something like this ?
Code:
 If Me.DueDate < Date Then
    rtn = MsgBox(DLookup("nonEnglishMsgBoxTxt", "Tmsgbox", "ID=1"), vbOKCancel, "Verify Date")

but for some reason it doesnt work
1725992314972.png
 
So what is the name of that table?
 
i've looked at it and either i didn't find it or just simple didn't get it.

isn't the simple way to do something like this ?
Code:
 If Me.DueDate < Date Then
    rtn = MsgBox(DLookup("nonEnglishMsgBoxTxt", "Tmsgbox", "ID=1"), vbOKCancel, "Verify Date")

but for some reason it doesnt work
View attachment 116014
Try:
MsgBox (DLookup("nonEnglishMsgBoxTxt", "Tmsgbox", "msgboxID=1"), vbOKCancel, "Verify Date")
The ID is msgboxID, not ID
 
One set of brackets too many:
Code:
MsgBox DLookup("nonEnglishMsgBoxTxt", "Tmsgbox", "msgboxID=1"), vbOKCancel, "Verify Date"

As already explained, my FormattedMsgBox is only needed if you use a language with a Unicode character set
 
i thought it could read non-Unicode... :(

What does 'it' refer to here? Standard MsgBox or FormattedMsgBox?

To repeat, a standard message box cannot handle Unicode characters:
MsgBox DLookup("NonEnglishText", "tblTest", "MsgID = 1"), vbOKOnly, "JapaneseText"

1726041116443.png


This is the same message as a formatted message box:
FormattedMsgBox DLookup("NonEnglishText", "tblTest", "MsgID = 1"), vbOKOnly, "JapaneseText"

1726041058548.png


This is the data source used for both of those above
1726041266683.png
 
What does 'it' refer to here? Standard MsgBox or FormattedMsgBox?
it was for standard
To repeat, a standard message box cannot handle Unicode characters:
got it now! thank you.
FormattedMsgBox
for some reason it doesnt work for me...

1726045956665.png


my data source
1726046070454.png


once i remove the word "formatted" it works , but can't display unicode. so the problem is ... it just doesnt like when i add "formatted".
 
If you want, you can use bold text for the first part of the message. Read the article to find out how to do so.
 

Users who are viewing this thread

Back
Top Bottom