Generate a Call Log numer

  • Thread starter brian3d via AccessMonster.com
  • Start date
B

brian3d via AccessMonster.com

Ok, I'm stumped here, maybe because my grasp of VBA is so little, but here is
what I'm trying to do.
I have a "Call Log" data base were tech support personal will enter in the
customers complaints.
What I need is a way to generate a CL#, but I prefer that this happends in
the "beforeupdate" event of the call log field.
What is the best practice here, a macro or a VBA script, and just what is the
code? I've looked through alot of the examples on this site, and I'm feeling
quite toasty trying to understand them. Can any one explain in plain english
for me?

Very much apprecate any help!
Brian
 
P

pietlinden

Ok, I'm stumped here, maybe because my grasp of VBA is so little, but here is
what I'm trying to do.
I have a "Call Log" data base were tech support personal will enter in the
customers complaints.
What I need is a way to generate a CL#, but I prefer that this happends in
the "beforeupdate" event of the call log field.
What is the best practice here, a macro or a VBA script, and just what isthe
code? I've looked through alot of the examples on this site, and I'm feeling
quite toasty trying to understand them. Can any one explain in plain english
for me?

Very much apprecate any help!
Brian

Just use an autonumber. the actual value of an autonumber is
meaningless. If you create a new record and cancel out of it, so that
the record is not written to the table, the number gets "used up" and
discarded, so you can have gaps in the sequence, but the values will
be unique. Why do you need a specific number? You can use DMAX()+1
and assign it in the BeforeInsert event of your form. But it doesn't
work that well in a multi-user environment.
 
B

brian3d via AccessMonster.com

Thanks for the reply;
The number does not have to be sequenced perfectly, it can have gaps. The
number is just for call log tracking, an so I need a number sequence for that,
example, "CL12345", nothing complex really, though it is a multiuser
environment.
DMax, I'll have to look into it since I'm not familiar with it yet.
I did find one solution that seems to work for me though, "CL" & Format(Now(),
"mmddyyhhnnss") which I placed in the text box of the form it self. Gives me
pretty much what I'm looking for, though it took a few hours of digging
before I found it, lol.

Ok, I'm stumped here, maybe because my grasp of VBA is so little, but here is
what I'm trying to do.
[quoted text clipped - 12 lines]
Just use an autonumber. the actual value of an autonumber is
meaningless. If you create a new record and cancel out of it, so that
the record is not written to the table, the number gets "used up" and
discarded, so you can have gaps in the sequence, but the values will
be unique. Why do you need a specific number? You can use DMAX()+1
and assign it in the BeforeInsert event of your form. But it doesn't
work that well in a multi-user environment.
 
Top