I am using Access to import information from Excel and then cycle through the data. I do not have control of the information that is in the Excel document. The Excel document is used for performing audits and I am doing reporting on the results. Recently a change was made so that some of the answers are no longer Yes/No. Answer may be “No – Document missing”. I created a table that stores Yes/No/NA responses to be able to capture these changes however I now have stumbled upon an issue.
yText = Nz(Dlookup("yText","tblQuestions","Group = '" & group & "' AND Question = " & qID), "Yes")
The yText is used in a dynamic SQL string so because that value stored in the field will be ‘Yes’ as a string I need yText to equal ‘Yes’ but instead VBA changes yText = -1. The same issue occurs with nText = ‘No’. Is there any way to prevent this behavior?
You can use Format within DlookUp: