Ive got a project where the user is asked for three responses, these responses, when the appropriate button is clicked, are added to a listbox on a second form and the user can view the items by pressing a button to display the second form.
The problem i have is, when the program is closed and re-opened the items that were in the listbox are now gone.
Ive been messing about with some code using the SaveSetting and GetSetting functions but havent been able to get it right yet.
Heres what ive got so far
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "Settings", "LIST", list1.ListIndex
End Sub
and on the second form
Private Sub Form_Load()
For X = 0 To list1.ListCount - 1
list1.AddItem (X)
Next
On Error GoTo aaron:
list1.ListIndex = GetSetting(App.EXEName, "Settings", "LIST"
aaron:
End Sub
Can any of you guys please help?!?
Cheers
r3b00t
The problem i have is, when the program is closed and re-opened the items that were in the listbox are now gone.
Ive been messing about with some code using the SaveSetting and GetSetting functions but havent been able to get it right yet.
Heres what ive got so far
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "Settings", "LIST", list1.ListIndex
End Sub
and on the second form
Private Sub Form_Load()
For X = 0 To list1.ListCount - 1
list1.AddItem (X)
Next
On Error GoTo aaron:
list1.ListIndex = GetSetting(App.EXEName, "Settings", "LIST"
aaron:
End Sub
Can any of you guys please help?!?
Cheers
r3b00t