Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub convertToValueList(theListBox As Access.ListBox)
Dim rs As DAO.Recordset
Dim strSql As String
Dim fldField As DAO.Field
Dim strLstValue As String
Dim intColCount As Integer
Dim intColCounter As Integer
Dim intRowCounter As Integer
If theListBox.RowSourceType = "Table/Query" Then
intColCount = theListBox.ColumnCount
strSql = theListBox.RowSource
theListBox.RowSource = ""
Set rs = CurrentDb.OpenRecordset(strSql)
theListBox.RowSourceType = "Value List"
Do While Not rs.EOF
For intColCounter = 0 To intColCount - 1
strLstValue = strLstValue & """" & CStr(Nz(rs.Fields(intColCounter), " ")) & """;"
Next intColCounter
intRowCounter = intRowCounter + 1
rs.MoveNext
strLstValue = Left(strLstValue, Len(strLstValue) - 1)
theListBox.AddItem (strLstValue)
strLstValue = ""
Loop
End If
End Sub