Hi I am using the code below that displays a message box. The problem is that what is held in the variable TheMessage is repeated multiple times. When I add a watch to the variable it only has the sentence once
Sub VM(ByVal oNumber As Integer) If oLanguage = "" Then MsgBox "Language error. Please exit the system and log in again!" Exit Sub End If Dim oCriteria As String Dim TheMessage As String oCriteria = "[Validation Number] = " & oNumber Debug.Print oCriteria TheMessage = Nz(DLookup("[" & oLanguage & "]", "[Validations]", oCriteria), "")'Stop 'Debug.Print oCriteria 'Debug.Print TheMessage MsgBox TheMessage, , "CAVR - ATD"End Sub
If i remember correctly Dlookup returns only 1 entry so 2 possibilities 1.You have stored multiple lines in the field (just make a form out of the table with the Form Wizard) 2. Somewhere there's a loop and another msgbox/message
Thanks for the advice. Here is the table, where I have not repeated any wording. When I look up the EN I get one sentence but when I look up the FR I get multiple. Very strange
The table looked normal because I think that pasting from the Google translator had a number of blank spaces or perhaps a carriage return before the sentence, which made it seem blank, causing me to paste a few more times because it just looked blank
you could also verify that with a select sql statement, such as:
Open in new window