Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Random ID generator

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Random ID generator
"erick-flores" <chunkyflores[ at ]hotmail.com> 07.07.2006 20:45:03
Hello all, I know this question has been asked a lot. But I just cant
find the right answer. I will like to generate a random ID number into
my ID field (which is the primary key in my Access db) everytime I open
a form, how do I do this, so when I load the form the ID number is
already in there, and the user can not change it

Help pleaseee, thanks

RE: Random ID generator
Kalyan Reddy 08.07.2006 04:35:15
Hello,

I have answered this at the link below
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2801

--
Kalyan Reddy
Visit http://www.autonomysystems.com




"erick-flores" wrote:

[Quoted Text]
> Hello all, I know this question has been asked a lot. But I just cant
> find the right answer. I will like to generate a random ID number into
> my ID field (which is the primary key in my Access db) everytime I open
> a form, how do I do this, so when I load the form the ID number is
> already in there, and the user can not change it
>
> Help pleaseee, thanks
>
>
Re: Random ID generator
"erick-flores" <chunkyflores[ at ]hotmail.com> 10.07.2006 18:55:15
Hello, this is what I am doing, and I cant get it to work
I clicked on On Load Event, then I tried putting different lines of
code. The field on my ID is called "ID" (I created a db in Access and
add a field for each table name: ID). I then drag and drop all the
fields from one of my table to the form, so the ID field is in the
form. My question is, how do I write this code, where do I put the "ID"
name in the code. Is it like: var ID =
new ActiveXObject("Scriptlet.TypeLib").guid.substring( 0, 38);
or
var ID = System.Guid.NewGuid(); ?
is that all the code I need to write? I am so confused, sorry for been
such a novice.
I tried both codes and they did not work, i just wrote those lines like
this:
function XDocument::OnLoad(eventObj)
{
var ID = new ActiveXObject("Scriptlet.TypeLib").guid.substring( 0,
38);// Write your code here
}

Do I need to write something else ???

Pleasee helppp

Thank youu

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net