Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble retrieving information using GetSetting

Status
Not open for further replies.

r3b00t

Technical User
Aug 13, 2002
45
GB
Im having trouble gettig information using GetSetting.
I have a list of details that is accessed by using the Submit button, the code i have for this goes like:

SaveSetting "Callbacks", "To Do", "Callback List", List1
' List info from text boxes in List1 with 5 spaces between each entry
frmCallbacks.List1.AddItem txtCaseRef.Text & Space(20) & txtDate.Text & Space(20) & txtTime.Text
' Clear all text boxes
txtCaseRef.Text = ""
txtDate.Text = ""
txtTime = ""
txtCaseRef.SetFocus

Which i thought should save the information in the listbox to the registry and then ive got a line of code:

Private Sub Form_Load()
List1 = GetSetting("Callbacks", "To Do", "Callback List", "List1")
End Sub

To load the information that had been saved to the registry but this just dont work, i know im doing something wrong, but what?

Any helpers please???

Regards

r3b00t
 
<SaveSetting &quot;Callbacks&quot;, &quot;To Do&quot;, &quot;Callback List&quot;, List1>
Will save just the current value of List1 not all the content of List1.

<List1 = GetSetting(&quot;Callbacks&quot;, &quot;To Do&quot;, &quot;Callback List&quot;, &quot;List1&quot;)>
That will just set List1 to the saved setting. If list1 is not aleady populated it will not do that for you.

You probably want to save each entry of List1, something like

SaveSetting &quot;Callbacks&quot;, &quot;To Do&quot;, &quot;Callback List Count&quot;, List1.List1.Count
for i = 0 to List1.Count-1
SaveSetting &quot;Callbacks&quot;, &quot;To Do&quot;, &quot;Callback List&quot; & i, List1.List(i)
next

And similarly to reload the list
Does that help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top