I'm trying to search for a specific value on a table linked with sql using DLookUp function. However, the string that I'm searching for is in Thai language. Here's my code.
Dim cust_Id1 As Variant: cust_Id1 = DLookup("[CustID]", "dbo_TblCustomer", _
"FullName=" & "'" & CustName & "'")
CustID.Value = cust_Id1
What I want to do is find a customer's id by customer's name and store it in a variable. I know that I can query the SQL like the code below.
SELECT CustID
FROM [aTable].[dbo].[TblCustomer]
WHERE FullName LIKE N'นามสมมุติ'
Is there a way to do it using DLookUp function? If not, what are other ways to get CustID value?