Hi,
I have a table with multiple fields as Textbox, and one of the field is set as Listbox with values and multiple selection allowed.
Using DAO, I would like to iterate and pull all data from all fields, including that listbox.
The sFieldInput will jammed once it hit the field "mbr_selection" as it's a listbox field with values.
Thanks
I have a table with multiple fields as Textbox, and one of the field is set as Listbox with values and multiple selection allowed.
Using DAO, I would like to iterate and pull all data from all fields, including that listbox.
Code:
sTable = "tblUser"
sProjId = "5"
Set rs = CurrentDb.OpenRecordset("SELECT * FROM " & sTable & " WHERE proj_id = " & sProjId & "", dbOpenSnapshot)
If rs.RecordCount <> 0 Then
For i = 1 To rs.Fields.Count - 1
rs.MoveFirst
Do Until rs.EOF
sFieldName = Nz(rs.Fields(i).Name)
If sFieldName = "mbr_selection" Then
' This is the listbox that I need to populate the value from the member
selection.
End If
sFieldInput = Nz(rs.Fields(i))
End If
rs.MoveNext
Loop
End If
The sFieldInput will jammed once it hit the field "mbr_selection" as it's a listbox field with values.
Thanks