Hi everyone

I have a table with 3 columns

pk_itm_code
name
fk_code

The pk_itm_code is taken from another master table. Now my requirement is automatic generation of fk_code

fk_code = pk_itm_code + "PT" + random generated no. (startin from 1)

If the user selects same pk_itm_code 2 times then the fk_code will be

(pk_tim_code)PT1
(pk_tim_code)PT2

Once he selects the other pk_itm_code it should again start with 1 and not 3

I hope u got my problem

Please help me

Thanks

A Table, as in, an access database?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.