I have a database installed on my pocket PC, and am am trying to write a small apllication for data collection.
As you know that you can't have a "ID" field in a Pocket Databse which generates it's own random number, so you have to insert a random number yourself.
I have this code which generates a 10 digit random number:
Dim NewID As Long
Dim Cntr As Integer
For Cntr = 1 To 10
NewID = NewID & Int(Rnd * 10)
But when I try to enter it into the table:
rs.Fields("ID") = NewID
I get a error saying "A literal value in the command overflowed the range of the type of the associated column"
The data type of the ID column in table is a Long Integer as it should be. I have tried to convert the NewID variable in to a Long Interger via CLng(NewID) but it still throws the same error.
Any ideas ?