How to code fields

  • Thread starter Thread starter dimebag
  • Start date Start date
D

dimebag

Guest
ok guys here's the deal, im making a database for website customers for my firm, it will have 3 tables; customers, trials, old trials.

what i need to know is, can (and if so, how do) i enter code to automatically generate figures in fields.

so far i have these 3 tables as excel spreadsheets, an example of the kind of code i need is...

there is a password field, which is generated from the first 3 characters of the forename (in field B4), and first 3 characters of the surname (in field A4), turned into lower case, and with an added random number at the end (which is generated in field P4)
for Dave Johnson it would be 'davjoh56' - 56 being the number generated in P4
the code i use for this would be "=LOWER(LEFT(B4,3)&LEFT(A4,3))&P4"

in access:
'B4' is called "forename"
'A4' is called "surname"
'P4' is called "number"
and the table is called "trials"

can anybody answer these questions:
can this type of formula be used in access to generate fields?
what will the code be for this example?
where will i enter the code?

any information is very much appreciated!!!!
 
I don't know if this will help, but I only see this being done in a query. Access tables allow for a lookup to another table. You can either have the table be the name and surname, and use a query to create the number column with a formula, or I am not sure how you would "create" it in the table.

It sounds like you might want to try the query idea. The numbers column really isnt a real piece of data anyway, it is a combination of data represented for the user.

Look at query formulas, and check back if you need more help.
 

Users who are viewing this thread

Back
Top Bottom