I had a problem in Access, that made havoc to old projects i had, as i have a form that i use a general utility in multiple .mdb programs.
and I have in them a ListBox, that gets filled by an array.
now the problem comes if i have an array of Strings, that have multiple or one of its items, not initialized, and then i try to add its content to the listbox, then MS Access crashes totally, without knowing what is the problem.
I had sometime before pinpointed the problematic line, and to understand the why.
to repeat the error, make a form, and add to it a listbox, and make its property “Row Source Type = Value List”
then add a button, and insert into its click event the following lines of code:
Private Sub btnAddItemsSame_Click() On Error Resume Next Dim arr(50) As String Dim i As Integer For i = 0 To 10 Me.lstBox.AddItem arr(i) Next End Sub
also, made a test .mdb file for others to download.