I type Hebrew letters in vba and get gibeerish on form label (1 Viewer)

bmkol

Member
Local time
Today, 18:58
Joined
Dec 2, 2021
Messages
39
Hi everyone.

I type Hebrew letters in vba and get gibeerish on form label.

Here is the vba code:

'Show results on labaels
Me.lblKoteret1.Caption = "יש"
Me.lblKamutChidushim.Caption = SoferReshumot
Me.lblKoteret2.Caption = "חידושים לפסוק " & Me.cmbPasuk

and this is what I get on the form:
1639656556421.png


Any idea why?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:58
Joined
Feb 28, 2001
Messages
27,317
Ranman256 is correct. Don't forget that EVERY TEXT-ORIENTED CONTROL has its own potential font setting. Since there is a limit of 768 controls on a form, you could in theory have 768 different fonts in use on the same form (though you would probably run out of resources first). You surely could have one font on a textbox and a different font for its label. Find that label in design mode, check the font name. And the UNICODE suggestion also applies.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:58
Joined
May 7, 2009
Messages
19,246
can you change it to a Textbox?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:58
Joined
Feb 28, 2001
Messages
27,317
Here is a description of the property you want to use:


If you checked, you would find that Label, ComboBox, and Listbox objects also have that property. Also Command Buttons, IF they are not using an image, can have a .Caption that would have a .FontName associated with it.
 

bmkol

Member
Local time
Today, 18:58
Joined
Dec 2, 2021
Messages
39
can you change it to a Textbox?
I changed one of them to a textbox but still the same problem

1639901219992.png


What I don't understand is that when I type in the property label manually it does work ... the problem is when I do it from vba
 

bmkol

Member
Local time
Today, 18:58
Joined
Dec 2, 2021
Messages
39
Font problem.
and make sure Access is set to use UNICODE characters.
Thank you for your reply but it is not the problem becuase I can type manually in the property itself. The problem is when I do it from VBA
 

bmkol

Member
Local time
Today, 18:58
Joined
Dec 2, 2021
Messages
39
Here is a description of the property you want to use:


If you checked, you would find that Label, ComboBox, and Listbox objects also have that property. Also Command Buttons, IF they are not using an image, can have a .Caption that would have a .FontName associated with it.
Thank you for your reply but it is not the problem becuase I can type manually in the property itself. The problem is when I do it from VBA
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:58
Joined
May 7, 2009
Messages
19,246
if you put those hebrew words to a table and Dlookup() the table, it will display it correctly?
see this demo.
 

Attachments

  • hebrew.accdb
    404 KB · Views: 185

bmkol

Member
Local time
Today, 18:58
Joined
Dec 2, 2021
Messages
39
if you put those hebrew words to a table and Dlookup() the table, it will display it correctly?
see this demo.
Yes. You helpd me last time with it and it worked. This case is different. I use vba to put the Hebrew in a label or textbox

Me.lblKoteret1.Caption = "יש"
 

bmkol

Member
Local time
Today, 18:58
Joined
Dec 2, 2021
Messages
39
if you put those hebrew words to a table and Dlookup() the table, it will display it correctly?
see this demo.
Also, if I will just use something like:
Me.lblKoteret1.Caption = me.lblSample.caption
this will work too without using the dlookup like you sent me
 

Users who are viewing this thread

Top Bottom