|
I have an the following application setting [Name: PO / Type: Integer / Scope: User / Value: 100001]
This setting increments every time the user logs into the application and is displayed in a textbox - it is working fine on 4 different workstations - but on workstation 5 it is only displaying 1 then 2 then 3 and so on instead of 100001,100002,100003 . . . ..
There is a mixture of operating systems anything from XP to Windows 8. Workstation 5 is Windows 7.
Is there something obvious I'm missing?
Thanks,
MB
|
|
|
|
|
Without knowing anything about how you implemented this functionality, it's pretty much impossible to tell you what's going wrong.
How are you getting this setting and from where? How are you updating this setting and persisting it?? We'd need to see the relavent code snippets.
|
|
|
|
|
OK - lets see if this helps - have the following variable under Public Class Main:
Dim poIncNo As Integer
Then in the formLoad Event I have:
txtBx_poNo.Text = genPoNo(currUser)
Private Function genPoNo(ByVal user As String) As String
Dim strNum As String = "1"
poIncNo = My.Settings.po + 1
Dim poNum As String
Select Case user
Case uFred
poNum = strNum & userId + CStr(poIncNo)
Return poNum
End Select
End Function
In Application.Settings I have:
Name = po
Type = integer
Scope = user
Value = 100001
Thanks,
MB
|
|
|
|
|
OK, so are these application-scope settings or user-scope settings??
You also don't have any code in what you posted that sets the settings with new values and persists them.
|
|
|
|
|
Dave,
It is 'user-scope'
Private Function genPoNo(ByVal user As String) As String
08 Dim strNum As String = "1"
09 poIncNo = My.Settings.po + 1 '----IT'S INCREMENTED HERE !
10 Dim poNum As String
11 Select Case user
12 Case uFred
13 poNum = strNum & userId + CStr(poIncNo)
14 Return poNum
15 End Select
16 End Function
Thanks MB
|
|
|
|
|
mebjen wrote: poIncNo = My.Settings.po + 1 '----IT'S INCREMENTED HERE !
NO, IT'S NOT! You set the value of poIncNo to the setting + 1, but you never showed where you saved that new value back into settings!
|
|
|
|