Generate NUmber

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
Have a customer table with these fields: LastName;FirstName; Time(24 hour
clock)
want to generate an automatic number use the 1 letters of last name and
first name and the clock time.
for example bush, george, 18:00hr. then number should be BG1800
THANKS
 
You can get that by using a formula.

Left([LastName],1) & Left([Firstname],1) & Format([Time],"hhnn")

That will not work as a field, but can be calculated whenever you need it.
If you have to store the redundant data in the table, you will have to use a
query or vba code in a form to store the value into the field.
 
If you should be using a form to enter the information, on the BeforeUpdate
event of your form, you can apply the formula indicated below. Just assign
it to a field that is bound to the table.

HTH

Rob Mastrostefano

--
FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

FMS Advanced Systems Group
http://www.fmsasg.com/


John Spencer said:
You can get that by using a formula.

Left([LastName],1) & Left([Firstname],1) & Format([Time],"hhnn")

That will not work as a field, but can be calculated whenever you need it.
If you have to store the redundant data in the table, you will have to use
a query or vba code in a form to store the value into the field.


derrick said:
hi
Have a customer table with these fields: LastName;FirstName; Time(24 hour
clock)
want to generate an automatic number use the 1 letters of last name and
first name and the clock time.
for example bush, george, 18:00hr. then number should be BG1800
THANKS
 
Back
Top