All
I have a combobox which contains a list of words which are stored in a table.
for e.g. table tblWords
ID Word 1 Dog 2 Cat
Many of these words have synonyms but to have it standardized only the predefined words in that table are allowed. So I have a table tblSynonyms
ID Word_FK Synonym 1 1 Hound 2 1 Canine 3 2 Kitty 4 2 Pussycat
I have a combobox which is linked with the first table. If the user enters a word which is not in the list, it must be searched into the second table. If it is in, it must be replaced by the related word in the first table.
So with other words, if the user types in "Canine" in the combobox and leaves the field, the value must be replaced by Dog.
I tried with code below, but I still get a message the value is not in the list although it is and NewData does get the correct word from the first table.
Code:Private Sub Ingredient_fk_NotInList(ByRef NewData As String, Response As Integer) intX = Nz(DFirst("Word_fk", "tblSynonyms, "synonym='" & NewData & "'"), 0) If intX <> 0 Then NewData = DFirst("Word", "tblWords", "teller=" & intX) End If End Sub