Saving primary Key

kabir_hussein

Registered User.
Local time
Today, 09:26
Joined
Oct 17, 2003
Messages
191
Hi i asked a question couple of days ago where i wanted to know if there is a way you can get a primary key byt adding two different fields togeather.

i was told to use the following code

=[IdentifierCode] & "" & [item No]

which worked fine but i have realsied that as i have changed the control source of the field, it does not save on to the table.

Does anyone know a way round this. i have attached a jpg file

many many thanks for all help recieved
 

Attachments

  • PRIMARY.JPG
    PRIMARY.JPG
    13.3 KB · Views: 130
Last edited:
Hi,

I'm not entirely sure that I understand your problem, what do you mean by changing the control source of the field? Do you mean change the control source of the text box on your form?


You could try making a composite key out of the two fields

If you do change the control source of the text box, then you will need to change this code:

=[IdentifierCode] & "" & [item No]

To reflect the change you made, there is no way around this.
 
kabir_hussein said:
=[IdentifierCode] & "" & [item No]

=[IdentifierCode] & [item No]

This is a tidier concatenation. :)
 
hi many thanks both the replies

what i mean in order to put the code in to the field i changed the control source

i have added a picture in design mode to explain what i mean

as you notice because i have changed the control source the data no longers saves onto the table (rsms Part No)only shown on form. is there a way i can save the code shown onto the table and thus store it as a PK

many many thanks once again
 

Attachments

  • code.JPG
    code.JPG
    10.9 KB · Views: 132

Users who are viewing this thread

Back
Top Bottom