4 Replies - 363 Views - Last Post: 29 November 2012 - 09:57 AM Rate Topic: -----

#1 mebjen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-November 12

VB.NET / APPLICATION SETTINGS

Posted 29 November 2012 - 06:45 AM

I have 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

Is This A Good Question/Topic? 0
  • +

Replies To: VB.NET / APPLICATION SETTINGS

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8365
  • View blog
  • Posts: 31,080
  • Joined: 12-June 08

Re: VB.NET / APPLICATION SETTINGS

Posted 29 November 2012 - 07:51 AM

We would have to see how you are storing the values, incrementing the values, and displaying the values.
Was This Post Helpful? 0
  • +
  • -

#3 mebjen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-November 12

Re: VB.NET / APPLICATION SETTINGS

Posted 29 November 2012 - 08:30 AM

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

This post has been edited by modi123_1: 29 November 2012 - 08:48 AM
Reason for edit:: highlight the text and just click the 'code' button in the text editor

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8365
  • View blog
  • Posts: 31,080
  • Joined: 12-June 08

Re: VB.NET / APPLICATION SETTINGS

Posted 29 November 2012 - 09:00 AM

As an aside it is a bad idea to store the purchase order number in the 'my.settings'. If you want the most current PO number then you should be polling the database where the POs are stored... this, as you mentioned, generates duplicate PO numbers.

What is the datatype of " My.Settings.po"?

Why are you using & and + in this line?
poNum = strNum & userId + CStr(poIncNo)


Speaking of - what is the purpose of 'strnum' in that function?
Was This Post Helpful? 0
  • +
  • -

#5 mebjen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-November 12

Re: VB.NET / APPLICATION SETTINGS

Posted 29 November 2012 - 09:57 AM

modi123_1,

The purchase order schema is as such: 14100001 - 1 leading number / 4 - user / 100001 - purchase order
This works for us, in that there is no possibility of duplicates because as mentioned earlier every time the purchase order program is loaded - the 100001 is incremented by 1 (which is and has been working on 4 other machines without a hitch).

The dataType of "My.Settings.po" is Integer . . . . .


MB
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1