autoincrement field with added numbers

j0se

Registered User.
Local time
Today, 16:58
Joined
Jan 15, 2003
Messages
57
Hi peeps,

hoping somebody can help me with this one:

I have a PK field called ID. It's value is autonumber but I want to add to that the month and year

eg: 41.02.04
42.02.04
43.02.04

Does anybody know how to go about this?
 
jose,

Autonumbers are just that - Numbers. They only hold numbers,
not xx.xx.xx.

Also, you can't assign values to them.

You'll have to use another field.

Wayne
 
ok

Got that

cheers
:)
 
But you could do this, leave the autp number alone, add a new field, and set the default to "=Date()" that what you could use that information how ever you like :D
________
SEX VIDEOS
 
Last edited:
sigh

OK - this is the way I'm going about this

I have an ID field, set to auto_increment and a JobID field, set as PK

In my form, I have some code behind the ID textbox control's AfterUpdate event:

' add this ID num to the JobID plue other bits...
JobID.text = ID.text & "test"


==
But it ain't working :(

Any more pointers please?
 
Do not use the .text property unless you know what you are doing and know that you need to use the .text property. Read the help entry to understand why. The default property of a control is its .value property and that is the one you should normally use. Also, since it is the default property, you don't need to specify it. You should however qualify form or report object references with "Me."

So your code would properly be:
Me.JobID = Me.ID & "test"

However, this won't work because JobID is numeric and you cannot concatenate a text string to it.
 
thanks

PS JobID is not numeric - it's text

I fixed it by creating and deleting a dummy entry "." in order to trigger the auto_increment field (ID). From thereon I can just get the value fo ID and append it to what I need

Cheers all
 
Last edited:

Users who are viewing this thread

Back
Top Bottom