Problem getting Unique Numbers from a shared Record Type 
Author Message
 Problem getting Unique Numbers from a shared Record Type

I am having problems with the following code.  I sometimes get the same
number on different stations.  Thanks if advance for any suggestions

Function GetNewShipNo() As String
Dim FHandle As Integer
Dim Tn As Long
Dim Shipper As ShipperTypeNo

On Error Resume Next

  FHandle = FreeFile
  Open "s:\LASTSHIP.DAT" For Random Lock Read Write As FHandle Len =
Len(Shipper)
  Do
    Err.Clear
    DoEvents
    Lock #FHandle, 1
  Loop Until Err.Number = 0

  Get #FHandle, 1, Shipper
  Tn = Shipper.LastNo + 1

  Shipper.LastNo = Tn
  Put #FHandle, 1, Shipper
  Unlock #FHandle, 1
  Close FHandle

  GetNewShipNo = CStr(Tn)
End Function



Sat, 13 Jul 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problem getting Unique Numbers from a shared Record Type

2. HELP-VB5: getting CD SERIAL NUMBER or unique

3. Getting a unique indentifying number from a PC?

4. Getting Machine Unique Number

5. Getting a unique user number from access

6. Getting Machine Unique Number

7. Getting one unique updateable record

8. Record Number - Making unique and then reusing

9. How do I add a unique identifier (number range) to an existing table with records

10. I am getting duplicate records, I mean everything is duplicate even Access record number

11. Select Unique Record Identifier problem with Linking SQL server

12. Problem updating unique records

 

 
Powered by phpBB® Forum Software