[Newbie] Need Help with Serial Numbers, Part 2

D

Doughboy

Sorry, my first post got cut off.

I am currently getting my feet wet with Access 2000, after years of
working with Filemaker Pro, so please bear with me.

I have a relatively simple Access database, in which records are added
via a web form. I'm having difficulty generating unique serial numbers
for each record. The serial numbers are of the form atl00001,
atl00002, etc. As for the number portion, I've defined a field called
serialNumber, which is of type AutoNumber, with a format of "00000".

I've also defined a field called serialNumberFinal, which is of type
text, but I can't seem to define the proper expression (calculation)
for it. I was hoping to define it using the Default Value field
property, but no luck. I then tried creating a dummy form with the
serialNumberFinal field on it, and setting the AfterEvent property to
the following expression:

="atl" & Str([tableName]![serialNumber])

However, if I submit a web form, the serialNumberFinal field remains
blank.

Am I even on the right track, or should I consider another approach?
 
M

Mike Painter

Doughboy said:
Sorry, my first post got cut off.

I am currently getting my feet wet with Access 2000, after years of
working with Filemaker Pro, so please bear with me.

I have a relatively simple Access database, in which records are added
via a web form. I'm having difficulty generating unique serial numbers
for each record. The serial numbers are of the form atl00001,
atl00002, etc. As for the number portion, I've defined a field called
serialNumber, which is of type AutoNumber, with a format of "00000".

I've also defined a field called serialNumberFinal, which is of type
text, but I can't seem to define the proper expression (calculation)
for it. I was hoping to define it using the Default Value field
property, but no luck. I then tried creating a dummy form with the
serialNumberFinal field on it, and setting the AfterEvent property to
the following expression:

="atl" & Str([tableName]![serialNumber])

However, if I submit a web form, the serialNumberFinal field remains
blank.
I would normally just place the serial number field on the form with "atl"
as the label.

There is nothing wrong with your idea however. The autonumber field gets
assigned when a new record is created so you could use an unbound field and
set it to
="atl" & Str([serialNumber]) or
="atl" & [serialNumber] or
="atl" & serialNumber since the brackets are only needed if there is a space
in the field name.
Note this is the source property and afterEvent is not needed.

If you use a query with a calculated value serialNumberFinal:"atl" &
serialNumber then you can use this query in all the forms and reports and
serialNumberFinal can be treated as just another field.

You will miss a few features in FileMaker but don't try to do things the
FileMaker way.
You will find that common tools are more in the same place in Access and
that there are more graphical tools that should have been in FMP then FMP
tools that should be in Access.

Review what a relational database is, the use of queries, what event driven
means and pay a lot of attention to those events.
In general you will write a *lot* less code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top