Hi,
got a problem with mulltiple fields. When i have one record in contactid(see dlookup), works fine, but when i get more than 1. listbox returns first contact name and shows error "Characters found after end of SQL statement. (Error 3142)".
In multiple fields, records delimiter is ;, which is end of statement in sql.
Anyhelp is very appreciated. Thanks in advance
strSqlContactEvent = "select tblcontact.contactname, tblcontact.contactid from tblcontact " & _
" where tblcontact.contactid = " & DLookup("[contactid]", "[tblEvents]", "[eventid] = " & lstEvent.Value)
With lstContact
.RowSource = "table/query"
.RowSource = strSqlContactEvent
.ColumnCount = 1
.BoundColumn = 2
End With
got a problem with mulltiple fields. When i have one record in contactid(see dlookup), works fine, but when i get more than 1. listbox returns first contact name and shows error "Characters found after end of SQL statement. (Error 3142)".
In multiple fields, records delimiter is ;, which is end of statement in sql.
Anyhelp is very appreciated. Thanks in advance
strSqlContactEvent = "select tblcontact.contactname, tblcontact.contactid from tblcontact " & _
" where tblcontact.contactid = " & DLookup("[contactid]", "[tblEvents]", "[eventid] = " & lstEvent.Value)
With lstContact
.RowSource = "table/query"
.RowSource = strSqlContactEvent
.ColumnCount = 1
.BoundColumn = 2
End With