This is a quite strange problem. I have set a setting variable in Application settings with following data:
- Name: county
- Type: integer
- Scope: user
- Value: 0
Yet when I reference it with this statement: MsgBox(My.MySettings.Default.county)
It alerts 1. Despite being the first to be executed as soon as form loads.
I’m assuming that the
My.MySettingsbit is a typo.Often when someone sees a different value than they expect when reading from
My.Settings, it seems to be that they are reading theDefaultrather than the actual value.I’d suggest trying to use just
MsgBox(My.MySettings.county)and see if that returns what you want.Otherwise, try to delete the
binandobjectdirectories of the project and try to re-compile and re-run and see if it might be something that had gotten “stuck” somewhere.