I've set the variable "WhichFav" to the Index of a control, and when i execute this:
VB Code:
Call saveini("favorites", WhichFav)
I get error saying: "Variable not defined" in the function saveini().
Contents of saveini():
VB Code:
Private Function saveini(KeySection As String, KeyKey As String) Dim lngResult As Long Dim strFileName strFileName = App.Path & "\options.ini" lngResult = WritePrivateProfileString(KeySection, _ KeyKey, KeyValue, strFileName) If lngResult = 0 Then 'An error has occurred Call MsgBox("An error has occurred while saving the options", vbExclamation) End If KeyValue = Trim(strResult) End Function
What is wrong?
Could it be that WhichFav is an integer?
I've tried CStr(WhichFav) but that doesn't work either, same error







Reply With Quote