I'm trying to get the setting of an option button (optEast) (optWest) but every time i push the play button it says "Invalid call procedure or argument" any help?
Printable View
I'm trying to get the setting of an option button (optEast) (optWest) but every time i push the play button it says "Invalid call procedure or argument" any help?
send us some code
ok thats kinda hard cause its on the other computer..
but heres my Form_Load code (which has the Get Settings stuff in it)
Code:Private Sub Form_Load()
txtAccount.Text = GetSetting(App.EXEName, "Settings", "txtAccount", vbNullString)
txtPassWord.Text = GetSetting(App.EXEName, "Settings", "txtPassword", vbNullString)
txtMessage.Text = GetSetting(App.EXEName, "Settings", "txtMessage", vbNullString)
txtGame.Text = GetSetting(App.EXEName, "Settings", "txtGame", vbNullString)
txtCDKey.Text = GetSetting(App.EXEName, "Settings", "txtCDKey", vbNullString)
txtTime.Text = GetSetting(App.EXEName, "Settings", "txtTime", vbNullString)
optEast.Value = GetSetting(App.EXEName, "Settings", "optEast", vbNullString)
optWest.Value = GetSetting(App.EXEName, "Settings", "optWest", vbNullString)
End Sub
----------Form Load Sub ^ ^----------
----------Save Settings Sub Below-------
Private Sub cmdSave_Click()
SaveSetting App.EXEName, "Settings", "txtAccount", txtAccount.Text
SaveSetting App.EXEName, "Settings", "txtPassWord", txtPassWord.Text
SaveSetting App.EXEName, "Settings", "txtCDKey", txtCDKey.Text
SaveSetting App.EXEName, "Settings", "txtTime", txtTime.Text
SaveSetting App.EXEName, "Settings", "txtMessage", txtMessage.Text
SaveSetting App.EXEName, "Settings", "txtGame", txtGame.Text
SaveSetting App.EXEName, "Settings", "optEast", optEast.Value
SaveSetting App.EXEName, "Settings", "optWest", optWest.Value
End Sub
The 4th parameter of GetSetting is for a default value if there is no value stored in the registry. You are getting the error because the Value of an option button must be True or False. Change that parameter to True or False (or leave it out) and you should be OK.
i took .value out, and it says the same error, i also tried switching it too True, and it had the same error..