dominicg123
Technical User
This code is used to update a text box with the value from the column 1 of a list box. Everything worked until when in the name of the field I have the ' character. Then I get a syntax error! I must have a typo somewhere...
for example this will work:
G:\Public\Dossiers\BRUN16\R.Brunet Annexe A.pdf
this will not:
G:\Public\Dossiers\BRUN16\R.Brunet Confirmation d'emploi.pdf
Dim lst As String
lst = Me.lstFileList.Column(1)
Me.Description = Nz(DLookup("[Contact Documents]![Description]", "Contact Documents", "[Linked Doc] = " & "'" & lst & "'"), "")
for example this will work:
G:\Public\Dossiers\BRUN16\R.Brunet Annexe A.pdf
this will not:
G:\Public\Dossiers\BRUN16\R.Brunet Confirmation d'emploi.pdf
Dim lst As String
lst = Me.lstFileList.Column(1)
Me.Description = Nz(DLookup("[Contact Documents]![Description]", "Contact Documents", "[Linked Doc] = " & "'" & lst & "'"), "")